Crater Container Library 0.2.0
|
|
Slab allocator. More...
#include <sla.h>
Data Fields | |
void ** | slabs |
Array of pointers to "slabs" (elements buffers). More... | |
void * | first_elem |
Pointer to first unallocated element. More... | |
uint64_t | slabs_len |
Number of slabs. | |
uint64_t | slab_cap |
Capacity of last slab. | |
uint64_t | elem_size |
Size of a single element. | |
Slab allocator.
Aggregates small, fixed size allocations to decrease dynamic memory requests. Maintains an array of "slabs", buffers of many fixed size elements. The unallocated elements are linked together so that unallocated elements can be found and returned and allocated elements can be deallocated trivially.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
void** cr8r_sla::slabs |
Array of pointers to "slabs" (elements buffers).
Each buffer is twice the size of the last. New buffers are allocated only whem all elements on all buffers have been allocated. Creating new buffers in this way allows the backing storage to be increased without needing to move existing allocated elements.
void* cr8r_sla::first_elem |