Manages a list of Slab and Pages, and allocates and frees homogeneous Pages from Slabs and Blocks from Pages.
More...
#include <BinnedAllocator.h>
Manages a list of Slab and Pages, and allocates and frees homogeneous Pages from Slabs and Blocks from Pages.
◆ allocate()
void* gts::internal::BlockAllocator::allocate |
( |
| ) |
|
- Returns
- An 'allocationSize' chunk of memory.
◆ blockSize()
GTS_INLINE size_type gts::internal::BlockAllocator::blockSize |
( |
| ) |
const |
|
inline |
- Returns
- The size of each Block in a Page.
◆ deallocate()
void gts::internal::BlockAllocator::deallocate |
( |
void * |
ptr | ) |
|
Free the memory in ptr.
- Parameters
-
workerId | The ID of the calling Worker thread. |
◆ init()
bool gts::internal::BlockAllocator::init |
( |
BinnedAllocator * |
pBinnedAllocator, |
|
|
size_type |
blockSize, |
|
|
size_type |
pageSize |
|
) |
| |
Initialize the BlockAllocator. This must happen before calling allocate.
- Parameters
-
pMemoryStore | The source of memory for this allocator. |
blockSize | The size of each Block in a Page. |
pageSize | The size of each Page in a Slab. |
◆ pageSize()
GTS_INLINE size_type gts::internal::BlockAllocator::pageSize |
( |
| ) |
const |
|
inline |
- Returns
- The size of each Page in a Slab.
◆ shutdown()
void gts::internal::BlockAllocator::shutdown |
( |
| ) |
|
Returns all allocated memory back to the OS and checks for memory leaks.