1 #ifndef Protium_SmallObjectAllocator_h_
2 #define Protium_SmallObjectAllocator_h_
28 void *
Allocate( std::size_t size,
bool doThrow );
43 std::size_t chunkSize = 4096,
44 std::size_t maxSmallObjectSize = 256,
45 std::size_t objectAlignSize = 4,
53 typedef ThreadingModel< AllocatorModel, MutexPolicy >
ThreadModel;
69 typename ThreadModel::Lock lock;
75 typename ThreadModel::Lock lock;
87 template <
class,
class>
class T,
91 template <
class>
class L,
104 #endif //File Guardian
static Host & Instance()
Use to get instance.
Manages a pool of fixed allocators.
void * Allocate(std::size_t size, bool doThrow)
Use to specify non-thread safe classes.
ThreadingModel< AllocatorModel, MutexPolicy > ThreadModel
Pool of allocation chunks.
Protium::Singleton::Singleton< AllocatorModel, Protium::Singleton::CreateStatic, LifetimePolicy, ThreadingModel > AllocatorSingleton
bool IsCorrupt(void) const
Helper struct to create static instances of classes.
Wrapper class for pthreads-style mutexes.
SmallObjectAllocator & operator=(const SmallObjectAllocator &)
SmallObjectAllocatorImplementation(void)
static bool IsCorrupted(void)
static SmallObjectAllocator & Instance(void)
Singleton small object allocator.
Protium::Allocation::FixedAllocator * fPool
SmallObjectAllocatorImplementation & operator=(const SmallObjectAllocatorImplementation &)
const std::size_t fAlignSize
Defines mutexes and policies to be used by threaded objects.
bool TrimExcessMemory(void)
std::size_t GetMaxObjectSize() const
static void ClearExtraMemory(void)
unsigned int GetPriority(SmallObjectAllocator< T, C, M, O, L, X > *)
void Deallocate(void *p, std::size_t size)
SmallObjectAllocator< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy > AllocatorModel
~SmallObjectAllocatorImplementation(void)
std::size_t GetAlignment() const
~SmallObjectAllocator(void)
const std::size_t fMaxObjectSize