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

Method Allocate

Source/Utility/MemoryPool.h:70–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68 }
69
70 inline T * Allocate()
71 {
72 static bool said= false;
73 if( !said )
74 {
75 printf( "Item size: %d->%d, MaxItems %d\n", sizeof( T ), ItemSize, MaxItems );
76 said = true;
77 }
78 Chunk * chunk( mFirstFree );
79 if( chunk != NULL )
80 {
81 mFirstFree = chunk->Next;
82 #ifdef _DEBUG
83 memset( chunk, 0xcd, ItemSize );
84 #endif
85 }
86
87 return reinterpret_cast< T * >( chunk );
88 }
89
90 inline void Deallocate( void * ptr )
91 {

Callers 1

allocateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected