Lurker News
Back to discussion

Comment by roca

roca1 reply#
Go achieves those low pause times by allocating 2x memory to the heap than it's actually using. There's no free lunch with GC.
pjmlp2 replies#
Same applies with manually memory management, you get instead slower allocators unless you replace the standard library with something else, and the joy of tracking down double frees and memory leaks.
roca1 reply#
I'm using Rust, so no double frees and no accidental forgetting to call free(). Of course you can still have memory leaks, but that's true in GC languages too.
pjmlp2 replies#
That is not manually memory management though, and it also comes with its own set of issues, like everyone that was tried to write GUIs or games in Rust is painfully aware of.

There is no free lunch no matter what one picks.

Continue this thread — 2 replies

AnIdiotOnTheNet1 reply#
I don't think that's as hard as you make it out to be. Notably, Zig does not have a default allocator and its standard library is written accordingly, making it trivial to ensure the use of the appropriate allocation strategy for any given task, including using a debug allocator that tracks double-free and memory leaks.
pjmlp1 reply#
Has Zig already sorted out the use-after-free story?

Continue this thread — 1 reply