MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / resize

Method resize

src/Bullet3Common/b3AlignedObjectArray.h:216–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214 }
215
216 B3_FORCE_INLINE void resize(int newsize, const T& fillData = T())
217 {
218 int curSize = size();
219
220 if (newsize < curSize)
221 {
222 for (int i = newsize; i < curSize; i++)
223 {
224 m_data[i].~T();
225 }
226 }
227 else
228 {
229 if (newsize > size())
230 {
231 reserve(newsize);
232 }
233#ifdef B3_USE_PLACEMENT_NEW
234 for (int i = curSize; i < newsize; i++)
235 {
236 new (&m_data[i]) T(fillData);
237 }
238#endif //B3_USE_PLACEMENT_NEW
239 }
240
241 m_size = newsize;
242 }
243 B3_FORCE_INLINE T& expandNonInitializing()
244 {
245 int sz = size();

Callers 15

exitHandlesMethod · 0.45
growTablesMethod · 0.45
computeMethod · 0.45
shiftFaceMethod · 0.45
runMethod · 0.45
averageVelocitiesMethod · 0.45
initCmpFlagsMethod · 0.45
initializeMethod · 0.45
computeContactsMethod · 0.45

Calls 2

reserveFunction · 0.85
sizeFunction · 0.50

Tested by

no test coverage detected