28 #ifndef GUM_FIXED_ALLOCATOR_H 29 #define GUM_FIXED_ALLOCATOR_H 82 void __init(
const std::size_t& blockSize,
const unsigned char& numBlocks);
87 void*
__allocate(
const std::size_t& blockSize);
92 void __deallocat(
void* p,
const std::size_t& blockSize);
131 const unsigned char& numBlocks = UCHAR_MAX);
192 #ifndef GUM_NO_INLINE 196 #endif // FIXEDALLOCATOR_H void * allocate()
Allocates a block.
void deallocate(void *pDeallocatedBlock)
Deallocates a block.
unsigned char __blocksAvailable
Number of blocks available in this chunck.
FixedAllocator(const std::size_t &blockSize, const unsigned char &numBlocks=UCHAR_MAX)
Constructor.
__Chunks::iterator __allocChunk
Last Chunk used for an allocation.
Inlines of gum::FixedAllocator.
Allocates objects of one given size.
void __deallocat(void *p, const std::size_t &blockSize)
Deallocates a block of memory.
std::size_t __blockSize
Size of a memory block allocated.
gum is the global namespace for all aGrUM entities
unsigned char __numBlocks
The maximum number of blocks a chunk can allocate.
void * __allocate(const std::size_t &blockSize)
Allocates a block of memory.
unsigned char * __pData
Pointer to the managed memory itself.
__Chunks::iterator __deallocChunk
Last Chunk used for a deallocation.
unsigned char __firstAvailableBlock
Holds the index of the first block available in this chunck.
std::vector< __Chunk > __Chunks
Vector of __Chunk objects.
Allocates objects of one given size.
const size_t & objectSize()
Returns the size of block allocated by this FixedAllocator.
~FixedAllocator()
Destructor.
void __init(const std::size_t &blockSize, const unsigned char &numBlocks)
Initializes a Chunk object.
void __release()
Releases the allocated memory.