Hacker News new | ask | show | jobs
by wmedrano 28 days ago
If you don't pass an allocator param in Zig, then the function basically can't allocate.
2 comments

No, that's just a convention. Any function can just create a new allocator, or import the global one, or use malloc from libc. Zig does nothing to enforce this convention.
isn't that more of a convention than an actual guarantee?