News for hackers. Stuff that matters.
Re:Go memory ballast: How I learnt to stop worrying and love... by dastx on Monday December 02, 2019 @02:03AM (#21680447)
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?

Re:Go memory ballast: How I learnt to stop worrying and love... by karlnowak on Monday December 02, 2019 @02:22AM (#21680528)

    func main() {

        // Create a large heap allocation of 10 GiB
        ballast := make([]byte, 10<<30)

        // Application execution continues

    }
Re:Go memory ballast: How I learnt to stop worrying and love... by bboreham on Monday December 02, 2019 @12:35PM (#21684596)
10<<30 is a lot. Perhaps you meant 2<<30?
Re:Go memory ballast: How I learnt to stop worrying and love... by Dylan16807 on Monday December 02, 2019 @02:05PM (#21685645)
Are you confusing shifting with exponents? 10<<30 is exactly five times bigger than 2<<30.
Re:Go memory ballast: How I learnt to stop worrying and love... by bboreham on Monday December 02, 2019 @03:21PM (#21686444)
Yes, I did.