[Small objects]

Collaboration diagram for Internals:


class  Loki::SmallObjAllocator
class  Loki::AllocatorSingleton< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy, MutexPolicy >
struct  Loki::Chunk
class  Loki::FixedAllocator


std::size_t Loki::GetOffset (std::size_t numBytes, std::size_t alignment)
void * Loki::DefaultAllocator (std::size_t numBytes, bool doThrow)
void Loki::DefaultDeallocator (void *p)

Function Documentation

void* Loki::DefaultAllocator ( std::size_t  numBytes,
bool  doThrow 

Calls the default allocator when SmallObjAllocator decides not to handle a request. SmallObjAllocator calls this if the number of bytes is bigger than the size which can be handled by any FixedAllocator.

numBytes number of bytes
doThrow True if this function should throw an exception, or false if it should indicate failure by returning a NULL pointer.

Definition at line 1019 of file SmallObj.cpp.

Referenced by Loki::SmallObjAllocator::Allocate().

void Loki::DefaultDeallocator ( void *  p  ) 

Calls default deallocator when SmallObjAllocator decides not to handle a request. The default deallocator could be the global delete operator or the free function. The free function is the preferred default deallocator since it matches malloc which is the preferred default allocator. SmallObjAllocator will call this if an address was not found among any of its own blocks.

Definition at line 1040 of file SmallObj.cpp.

Referenced by Loki::SmallObjAllocator::Deallocate().

std::size_t Loki::GetOffset ( std::size_t  numBytes,
std::size_t  alignment 
) [inline]

Calculates index into array where a FixedAllocator of numBytes is located.

Definition at line 1004 of file SmallObj.cpp.

Referenced by Loki::SmallObjAllocator::Allocate(), Loki::SmallObjAllocator::Deallocate(), Loki::SmallObjAllocator::IsCorrupt(), Loki::SmallObjAllocator::SmallObjAllocator(), and Loki::SmallObjAllocator::TrimExcessMemory().

Generated on Sun Feb 25 16:52:29 2007 for Loki by  doxygen 1.5.1-p1