| 297 | void operator=( const DynArray& ); // not supported |
| 298 | |
| 299 | void EnsureCapacity( int cap ) { |
| 300 | TIXMLASSERT( cap > 0 ); |
| 301 | if ( cap > _allocated ) { |
| 302 | TIXMLASSERT( cap <= INT_MAX / 2 ); |
| 303 | int newAllocated = cap * 2; |
| 304 | T* newMem = new T[newAllocated]; |
| 305 | memcpy( newMem, _mem, sizeof(T)*_size ); // warning: not using constructors, only works for PODs |
| 306 | if ( _mem != _pool ) { |
| 307 | delete [] _mem; |
| 308 | } |
| 309 | _mem = newMem; |
| 310 | _allocated = newAllocated; |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | T* _mem; |
| 315 | T _pool[INIT]; |
nothing calls this directly
no outgoing calls
no test coverage detected