A thread-safe bump (monotonic) allocator for user_cage: allocation is a pointer increment, deallocate() does nothing, and memory is committed in 1 MiB steps as it is used. Suited to data that is built once and freed all at once, or never. Its lock is held across fork(), so a child process can allocate even if another thread was allocating when it forked.
| Name | Description |
|---|---|
bump_allocator [constructor] | Construct from span |
allocate | |
deallocate | |
used | Bytes handed out so far, including alignment padding. |