| 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 | { |