| 44 | |
| 45 | public: |
| 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 | { |
nothing calls this directly
no outgoing calls
no test coverage detected