logoalt Hacker News

Johanx64 • today at 6:52 PM • 2 replies • view on HN

Arenas, etc is GC done right.

Or rather GC done explicit.

You control when and where and how garbage gets collected in various buckets and disposed off.

Without the performance hit of fully automatic GC.

> Risking memory leaks is crazy when it's not something the customer is demanding.

Memory leaks have NEVER been a significant source of bugs.

Memory corruption has always been the problem (lack of memory safety, ie. operating in perpetual unsafe block), not the memory leaks.

Memory leaks are relatively trivial to track and account for in comparison.


Replies

pron • today at 8:31 PM

Generational moving GCs work much like arenas, and they work without the limitations of arenas and without the performance hit of malloc/free. That's not to say arenas aren't very efficient and useful, but few languages make them convenient and composable enough (Zig), and even then they need to be used with care.

➕ show 1 reply
jeremyjh • today at 7:08 PM

[dead]