Hacker News new | ask | show | jobs
by throwbadubadu 1182 days ago
Such linear allocators are not too uncommon in embedded / static allocation context, but one definitely needs to know how they work. So first thought was you didn't read the docs, but docs do not clearly state that behavoour that is ugly (:
2 comments

> So first thought was you didn't read the docs, but docs do not clearly state that behavoour that is ugly (:

Yep, neither the name nor what little documentation there is a are really helpful, and that looks to be a long-standing issue (https://github.com/ziglang/zig/issues/3049).

Seems to me like this allocator should be renamed something like "FixedBufferBumpAllocator", which:

- leaves room for other fixed-buffer allocators (e.g. bitmap, slabs)

- spell out that there's something of note about the allocator, whose drawbacks the developer either would already be aware of or would be able to look up easily

There are basically no docs for this allocator.