0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00

std.heap.WasmAllocator: redo

The previous version had a fatal flaw: it did ensureCapacity(1) on the
freelist when allocating, but I neglected to consider that you could
free() twice in a row. Silly!

This strategy allocates an intrusive freelist node with every
allocation, big or small. It also does not have the problems with resize
because in this case we can push the upper areas of freed stuff into the
corresponding freelist.
This commit is contained in:
Andrew Kelley 2022-11-11 22:48:06 -07:00
commit e2e60f5ff9
3 changed files with 136 additions and 160 deletions