Module acid_alloc::slab
source · [−]Expand description
Slab allocation.
A slab allocator divides the managed region into a fixed number of equally-sized blocks. This design is ideal for allocating many values of a single type, and a combination of slab sizes can be useful in constructing more general-purpose allocators.
Characteristics
Time complexity
Operation | Best-case | Worst-case |
---|---|---|
Allocate | O(1) | O(1) |
Deallocate | O(1) | O(1) |
Fragmentation
Due to slab allocators’ fixed-size allocations, they exhibit no external fragmentation. The degree of internal fragmentation is dependent on the difference between the average allocation size and the allocator’s block size.
Structs
A slab allocator.