3 ms·
I'm confused. They say "above code" and whatnot, but I don't see any code is this article. Is this the same for everyone? How did they allocate that 10GB byte
by dastx 7y ago
I'm confused. They say "above code" and whatnot, but I don't see any code is this article. Is this the same for everyone?
How did they allocate that 10GB byte array?
- karlnowak 7y agofunc main() { // Create a large heap allocation of 10 GiB ballast := make([]byte, 10<<30) // Application execution continues }
- bboreham 7y ago10<<30 is a lot. Perhaps you meant 2<<30?
- Dylan16807 7y agoAre you confusing shifting with exponents? 10<<30 is exactly five times bigger than 2<<30.
- bboreham 7y agoYes, I did.