50#ifndef GUM_FIXED_ALLOCATOR_H
51#define GUM_FIXED_ALLOCATOR_H
106 void _init_(
const std::size_t& blockSize,
const unsigned char& numBlocks);
111 void*
_allocate_(
const std::size_t& blockSize);
116 void _deallocat_(
void* p,
const std::size_t& blockSize);
154 FixedAllocator(
const std::size_t& blockSize,
const unsigned char& numBlocks = UCHAR_MAX);
void deallocate(void *pDeallocatedBlock)
Deallocates a block.
FixedAllocator(const std::size_t &blockSize, const unsigned char &numBlocks=UCHAR_MAX)
Constructor.
_Chunks_::iterator _deallocChunk_
Last Chunk used for a deallocation.
unsigned char _numBlocks_
The maximum number of blocks a chunk can allocate.
std::size_t _blockSize_
Size of a memory block allocated.
~FixedAllocator()
Destructor.
std::vector< _Chunk_ > _Chunks_
Vector of Chunk objects.
_Chunks_::iterator _allocChunk_
Last Chunk used for an allocation.
const size_t & objectSize()
Returns the size of block allocated by this FixedAllocator.
void * allocate()
Allocates a block.
Inlines of gum::FixedAllocator.
gum is the global namespace for all aGrUM entities
Allocates objects of one given size.
void * _allocate_(const std::size_t &blockSize)
Allocates a block of memory.
unsigned char _firstAvailableBlock_
Holds the index of the first block available in this chunck.
void _deallocat_(void *p, const std::size_t &blockSize)
Deallocates a block of memory.
unsigned char * _pData_
Pointer to the managed memory itself.
void _init_(const std::size_t &blockSize, const unsigned char &numBlocks)
Initializes a Chunk object.
void _release_()
Releases the allocated memory.
unsigned char _blocksAvailable_
Number of blocks available in this chunck.