30 #ifndef GUM_FIXED_ALLOCATOR_H 31 #define GUM_FIXED_ALLOCATOR_H 84 void __init(
const std::size_t& blockSize,
const unsigned char& numBlocks);
89 void*
__allocate(
const std::size_t& blockSize);
94 void __deallocat(
void* p,
const std::size_t& blockSize);
133 const unsigned char& numBlocks = UCHAR_MAX);
194 #ifndef GUM_NO_INLINE 198 #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.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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.