| 287 | void operator=( const DynArray& ); // not supported |
| 288 | |
| 289 | void EnsureCapacity( int cap ) { |
| 290 | TIXMLASSERT( cap > 0 ); |
| 291 | if ( cap > _allocated ) { |
| 292 | TIXMLASSERT( cap <= INT_MAX / 2 ); |
| 293 | int newAllocated = cap * 2; |
| 294 | T* newMem = new T[newAllocated]; |
| 295 | TIXMLASSERT( newAllocated >= _size ); |
| 296 | memcpy( newMem, _mem, sizeof(T)*_size ); // warning: not using constructors, only works for PODs |
| 297 | if ( _mem != _pool ) { |
| 298 | delete [] _mem; |
| 299 | } |
| 300 | _mem = newMem; |
| 301 | _allocated = newAllocated; |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | T* _mem; |
| 306 | T _pool[INITIAL_SIZE]; |
nothing calls this directly
no outgoing calls
no test coverage detected