5 ms·
Suggestion for the blog post author: make a PR to the Zig docs to clarify this if it’s not already.
by aserafini 4y ago
Suggestion for the blog post author: make a PR to the Zig docs to clarify this if it’s not already.
- krut-patel 4y agoWill do, I have just been procrastinating too much!
- throwbadubadu 4y agoSuch 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 (:
- masklinn 4y ago> 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 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
- shp0ngle 4y agoThere are basically no docs for this allocator.