Quick Links: |
#include <bdlcc_skiplist.h>
Public Types | |
typedef SkipList_PoolManager | PoolManager |
Static Public Member Functions | |
static void * | allocate (PoolManager *poolManager, int level) |
static PoolManager * | createPoolManager (int *objectSizes, int numLevels, bslma::Allocator *basicAllocator) |
static void | deallocate (PoolManager *poolManager, void *address) |
static void | deletePoolManager (bslma::Allocator *basicAllocator, PoolManager *poolManager) |
This component-private utility handles the lock-free pool of list nodes.
typedef SkipList_PoolManager bdlcc::SkipList_PoolUtil::PoolManager |
static void* bdlcc::SkipList_PoolUtil::allocate | ( | PoolManager * | poolManager, | |
int | level | |||
) | [static] |
Reserve sufficient space for a node at the specified level
from the specified poolManager
, and return the address of the reserved memory.
static PoolManager* bdlcc::SkipList_PoolUtil::createPoolManager | ( | int * | objectSizes, | |
int | numLevels, | |||
bslma::Allocator * | basicAllocator | |||
) | [static] |
Create a new pooled node allocator that manages nodes up to the specified numLevels
as described by the specified objectSizes
. For i
in [0, numLevels)
, a node at level i
will have size objectSizes[i]
bytes. Use the specified basicAllocator
to supply memory. Return the address of the new allocator. Note that the behavior is undefined if basicAllocator
is 0.
static void bdlcc::SkipList_PoolUtil::deallocate | ( | PoolManager * | poolManager, | |
void * | address | |||
) | [static] |
Return the node at the specified address
to the specified poolManager
. The behavior is undefined if address
was not allocated from poolManager
.
static void bdlcc::SkipList_PoolUtil::deletePoolManager | ( | bslma::Allocator * | basicAllocator, | |
PoolManager * | poolManager | |||
) | [static] |
Destroy the specified poolManager
which was allocated from the specified basicAllocator
. The behavior is undefined if poolManager
was not allocated from basicAllocator
.