News for hackers. Stuff that matters.
Re:What is malloc doing, anyway? by tremon on Monday November 09, 2026 @03:47PM (#50431868)
To me the value of zig's approach is in being able to control the allocations that happen in (library) code. When you call a C function, all kinds of heap allocations may happen between the callee and malloc, even if the return value of the call is in caller-allocated memory. With zig, you can pass a local (arena) allocator instead and avoid uncontrolled global allocations.

There are no comments on this comment yet.