MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / replaceAllocation

Function replaceAllocation

Sources/Shared/Containers/SmallVector.cpp:96–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94 }
95
96 static void* replaceAllocation(void* newElts, std::size_t typeSize, std::size_t newCapacity, std::size_t vSize = 0) {
97 void* newEltsReplace = std::malloc(newCapacity * typeSize);
98 if (vSize != 0) {
99 std::memcpy(newEltsReplace, newElts, vSize * typeSize);
100 }
101 std::free(newElts);
102 return newEltsReplace;
103 }
104
105 // Note: Moving this function into the header may cause performance regression.
106 template<class Size_T>

Callers 2

mallocForGrowMethod · 0.85
growTrivialMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected