MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / reserve

Method reserve

physx/source/common/src/CmBlockArray.h:72–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 }
71
72 void reserve(PxU32 capacity)
73 {
74 if (capacity > mCapacity)
75 {
76 PxU32 nbSlabsRequired = (capacity + mSlabSize - 1) / mSlabSize;
77
78 PxU32 nbSlabsToAllocate = nbSlabsRequired - mBlocks.size();
79
80 mCapacity += nbSlabsToAllocate * mSlabSize;
81
82 for (PxU32 a = 0; a < nbSlabsToAllocate; ++a)
83 {
84 mBlocks.pushBack(reinterpret_cast<T*>(PX_ALLOC(sizeof(T) * mSlabSize, PX_DEBUG_EXP("BlockArray"))));
85 }
86 }
87 }
88
89 void resize(PxU32 size)
90 {

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
pushBackMethod · 0.45

Tested by

no test coverage detected