3 ms·
> 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'
by 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.