MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / CMemoryPool

Method CMemoryPool

Source/Utility/MemoryPool.h:46–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45public:
46 CMemoryPool()
47 : ItemSize( (sizeof( T ) + (Align-1)) & ~(Align-1) )
48 , mMemory( new u8[ MaxItems * ItemSize ] )
49 {
50
51 Chunk * first( NULL );
52
53 // Add chunks in reverse order
54 for( s32 i = MaxItems - 1; i >= 0; --i )
55 {
56 Chunk * chunk( reinterpret_cast< Chunk *>( &mMemory[ i * ItemSize ] ) );
57
58 chunk->Next = first;
59 first = chunk;
60 }
61
62 mFirstFree = first;
63 }
64
65 ~CMemoryPool()
66 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected