Module acid_alloc::bump
source · [−]Expand description
Bump allocation.
A bump allocator is a simple and fast allocator well-suited to allocating large numbers of objects that will be deallocated en masse. However, a bump allocator cannot free individual objects; all outstanding allocations must be freed in order to reclaim memory.
Characteristics
Time complexity
Operation | Best-case | Worst-case |
---|---|---|
Allocate | O(1) | O(1) |
Deallocate all | O(1) | O(1) |
Fragmentation
Because bump allocators can allocate blocks of any size, they suffer minimal internal fragmentation. External fragmentation becomes significant when many deallocations occur without deallocating all outstanding allocations.
Structs
A bump allocator.