MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / deallocate

Method deallocate

deps/physx/physx/source/foundation/src/PsTempAllocator.cpp:107–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void TempAllocator::deallocate(void* ptr)
108{
109 if(!ptr)
110 return;
111
112 Chunk* chunk = reinterpret_cast<Chunk*>(ptr) - 1;
113 uint32_t index = chunk->mIndex;
114
115 if(index >= sMaxIndex)
116 return NonTrackingAllocator().deallocate(chunk);
117
118 Foundation::Mutex::ScopedLock lock(getMutex());
119
120 index -= sMinIndex;
121 if(getFreeTable().size() <= index)
122 getFreeTable().resize(index + 1);
123
124 chunk->mNext = getFreeTable()[index];
125 getFreeTable()[index] = chunk;
126}
127
128} // namespace shdfnd
129} // namespace physx

Callers

nothing calls this directly

Calls 4

getMutexFunction · 0.50
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected