58 karma · joined August 28, 2021
Edit: yeah pwned when clicking the big green trust button
This happened to me lol. I copied a demo video from our landing page, and the host company somehow blocked our CDN, so the demo slide is just a blank page. Have to mouth the whole demo from memory, not too bad but it's really awkward.
This is explained right in the documentation about arena allocator. Arena allocator deallocate everything at once when it goes out of scope (with defer deinit()). You need to call .allocator() to get an Allocator struct because it's a pattern in Zig to swap out the allocator. And with this, other code can call alloc and free with out caring about the implementation.
This is just how arena allocator works and not related to Zig's design. You may take issue with how Zig doesn't have built-in interface and having to resort to this implementation struct returning the interface struct pattern, but I think the GP clearly explained the Why.