MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / _setSize

Method _setSize

3rd_party/Src/ode/ode/src/array.cpp:46–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45
46void dArrayBase::_setSize (int newsize, int sizeofT)
47{
48 if (newsize < 0) return;
49 if (newsize > _anum) {
50 if (_data == this+1) {
51 // this is a no-no, because constructLocalArray() was called
52 dDebug (0,"setSize() out of space in LOCAL array");
53 }
54 int newanum = roundUpToPowerOfTwo (newsize);
55 if (_data) _data = dRealloc (_data, _anum*sizeofT, newanum*sizeofT);
56 else _data = dAlloc (newanum*sizeofT);
57 _anum = newanum;
58 }
59 _size = newsize;
60}
61
62
63void * dArrayBase::operator new (size_t size)

Callers

nothing calls this directly

Calls 4

dDebugFunction · 0.85
roundUpToPowerOfTwoFunction · 0.85
dReallocFunction · 0.85
dAllocFunction · 0.85

Tested by

no test coverage detected