![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
Allocates objects of one given size. More...
Public Attributes | |
unsigned char * | _pData_ |
Pointer to the managed memory itself. More... | |
unsigned char | _firstAvailableBlock_ |
Holds the index of the first block available in this chunck. More... | |
unsigned char | _blocksAvailable_ |
Number of blocks available in this chunck. More... | |
Public Member Functions | |
void | _init_ (const std::size_t &blockSize, const unsigned char &numBlocks) |
Initializes a Chunk object. More... | |
void * | _allocate_ (const std::size_t &blockSize) |
Allocates a block of memory. More... | |
void | _deallocat_ (void *p, const std::size_t &blockSize) |
Deallocates a block of memory. More... | |
void | _release_ () |
Releases the allocated memory. More... | |
Allocates objects of one given size.
Has a fixed limit of allocation
Each object of type Chunk contains and manages a chunk of memory containing a amount of blocks. At construction time, you configure the block size and the number of blocks. A Chunk contains logic that allows you to allocate and deallocate memory blocks from that chunk of memory. When there are no more blocks available in the chunk, the allocation function returns zero.
Definition at line 80 of file fixedAllocator.h.
INLINE void * gum::FixedAllocator::_Chunk_::_allocate_ | ( | const std::size_t & | blockSize | ) |
Allocates a block of memory.
Definition at line 65 of file fixedAllocator_inl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE void gum::FixedAllocator::_Chunk_::_deallocat_ | ( | void * | p, |
const std::size_t & | blockSize | ||
) |
Deallocates a block of memory.
Definition at line 91 of file fixedAllocator_inl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE void gum::FixedAllocator::_Chunk_::_init_ | ( | const std::size_t & | blockSize, |
const unsigned char & | numBlocks | ||
) |
Initializes a Chunk object.
Definition at line 39 of file fixedAllocator_inl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE void gum::FixedAllocator::_Chunk_::_release_ | ( | ) |
Releases the allocated memory.
Definition at line 119 of file fixedAllocator_inl.h.
References gum::Set< Key, Alloc >::emplace().
unsigned char gum::FixedAllocator::_Chunk_::_blocksAvailable_ |
Number of blocks available in this chunck.
Definition at line 114 of file fixedAllocator.h.
unsigned char gum::FixedAllocator::_Chunk_::_firstAvailableBlock_ |
Holds the index of the first block available in this chunck.
Definition at line 109 of file fixedAllocator.h.
unsigned char* gum::FixedAllocator::_Chunk_::_pData_ |
Pointer to the managed memory itself.
Definition at line 104 of file fixedAllocator.h.