Hacker News new | ask | show | jobs
by TUSF 603 days ago
> What prevents anyone from dedicating a Zig memory allocator to the job (and all of its subtasks), and simply freeing the entire allocator at the end of the job? No baby-sitting needed.

Given the whole ecosystem is built around the Allocator interface, it's entirely feasible for the consumer of a library to pass in a Garbage Collecting allocator, and let it do the job of deciding what gets dropped or not.

Downside is that this is all at runtime, and you don't get the compile-time memory management that Rust has.

1 comments