Yes, but I think you missed the point of the parent comment.
> enabling developers to easily assign their own allocators
Through a combination of Zig's convention to pass around allocators instead of using a global allocator, the allocator interface's ability to return errors, and the Zig language forcing you to handle all errors (unless you explicitly discard them), a lot of Zig code is written with allocation failure in mind.
This means that you can seamlessly pass a custom allocator, say a bump allocator backed by a fixed buffer, to a function in some third-party library and still handle the case where the buffer runs out of space.
Rust is getting custom/local allocators as well.
Do you have any links about that?
I did a quick search but didn't find anything substantial.
I believe this tracks it: https://github.com/rust-lang/rust/issues/32838
Re:Some Thoughts on Zig
by AnIdiotOnTheNet on Friday July 22, 2022 @08:01AM
(#32191020)
Unfortunately no, there's nothing that can be done about an ABI that insists on lying to you. This is one of the reasons I think the Linux default is a really terrible idea.
Unless it zeros every page it allocated, I don’t see it being able to defend against it in practice.