MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / resize

Method resize

Engine/lib/convexDecomp/NvHashMap.h:975–996  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////// ! Resize array \param compaction If set to true and the specified size is smaller than the capacity, a new memory block which fits the size is allocated and the old one gets freed. */ /////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

973 */
974 //////////////////////////////////////////////////////////////////////////
975 NX_INLINE void resize(const NxU32 size, const bool compaction = false, const T& a = T())
976 {
977 if(size > mCapacity)
978 {
979 grow(size);
980 }
981 else if (compaction && (size != mCapacity))
982 {
983 recreate(size, NxMin(mSize, size));
984 }
985
986 for(NxU32 i = mSize; i < size; i++)
987 ::new(mData+i)T(a);
988
989 if (!compaction) // With compaction, these elements have been deleted already
990 {
991 for(NxU32 i = size; i < mSize; i++)
992 mData[i].~T();
993 }
994
995 mSize = size;
996 }
997
998
999 //////////////////////////////////////////////////////////////////////////

Callers 15

safeSubstrFunction · 0.45
reserveInternalMethod · 0.45
InitVoiceFunction · 0.45
source.cppFile · 0.45
UNLIKELYFunction · 0.45
setErrorMethod · 0.45
GetCompatibleLayoutFunction · 0.45
PrepareHrirDataFunction · 0.45
LoadResponsesFunction · 0.45
ProcessSourcesFunction · 0.45
al_printFunction · 0.45
setMessageMethod · 0.45

Calls 2

NxMinFunction · 0.85
TFunction · 0.50

Tested by

no test coverage detected