MCPcopy Create free account
hub / github.com/MaxBelkov/visualsyslog / EnsureCapacity

Method EnsureCapacity

sourcecommon/tinyxml2.h:286–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284
285private:
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];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected