Expand description
Bump pointer allocator
Structsยง
- Bump
Allocator - A bump pointer allocator. It keeps a thread local allocation buffer, and bumps a cursor to allocate from the buffer.
- Bump
Pointer - A common fast-path bump-pointer allocator shared across different allocator implementations
that use bump-pointer allocation.
A
BumpPointeris always initialized with cursor = 0, limit = 0, so the first allocation always fails the check ofcursor + size < limitand goes to the slowpath. A binding can also take advantage of this design to zero-initialize the a bump pointer.
Constantsยง
- BLOCK_
MASK ๐ - BLOCK_
SIZE ๐ - Size of a bump allocator block. Currently it is set to 32 KB.