| 284 | |
| 285 | private: |
| 286 | void EnsureCapacity( int cap ) { |
| 287 | if ( cap > _allocated ) { |
| 288 | int newAllocated = cap * 2; |
| 289 | T* newMem = new T[newAllocated]; |
| 290 | memcpy( newMem, _mem, sizeof(T)*_size ); // warning: not using constructors, only works for PODs |
| 291 | if ( _mem != _pool ) { |
| 292 | delete [] _mem; |
| 293 | } |
| 294 | _mem = newMem; |
| 295 | _allocated = newAllocated; |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | T* _mem; |
| 300 | T _pool[INIT]; |
nothing calls this directly
no outgoing calls
no test coverage detected