5 ms·
According to [1], arena allocators provide low-latency high-troughput garbage collection riding on top of "practically unlimited" virtual memory implementations
by giovannibonetti 1y ago
According to [1], arena allocators provide low-latency high-troughput garbage collection riding on top of "practically unlimited" virtual memory implementations of 64-bit machines.
However, it requires changes in the language level, so no wonder so few languages like Zig implement it.
[1] https://news.ycombinator.com/item?id=44403195 https://news.ycombinator.com/item?id=44403195
- SkiFire13 1y ago> According to [1], arena allocators provide low-latency high-troughput garbage collection No, arenas don't really provide garbage collection, they are just a way to organizer your data in such a way that you can more easily collect the garbage later on, but you still need to do that yourself (e.g. decide when to free the whole arena). That article then goes on to show a bunch of what are basically small specialized allocators. It doesn't really solve the problem, it just moves it. > However, it requires changes in the language level, so no wonder so few languages like Zig implement it. What changes does Zig make to "implement" this?
- giovannibonetti 1y ago> What changes does Zig make to "implement" this? The user has to pass the allocator around to all the functions that need to allocate data on the heap. I don't think every language is ready for that.
- SkiFire13 1y agoThat's not really a change at the language level. The language doesn't force you to do so, you can simply create an allocator as a global variable and avoid explicitly passing it around, which is basically what happens in every other language. The difference is instead social: everyone is onboard with the idea of explicitly passing allocators around.