MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / release

Method release

src/memory/SingleFrameAllocator.cpp:94–106  ·  view source on GitHub ↗

Release previously allocated memory.

Source from the content-addressed store, hash-verified

92
93// Release previously allocated memory.
94void SingleFrameAllocator::release(void* pointer, size_t size) {
95
96 // Lock the method with a mutex
97 std::lock_guard<std::mutex> lock(mMutex);
98
99 // If allocated memory is not within the single frame allocation range
100 char* p = static_cast<char*>(pointer);
101 if (p < mMemoryBufferStart || p > mMemoryBufferStart + mTotalSizeBytes) {
102
103 // Use default deallocation
104 mBaseAllocator.release(pointer, size);
105 }
106}
107
108// Reset the marker of the current allocated memory
109void SingleFrameAllocator::reset() {

Callers 2

~SingleFrameAllocatorMethod · 0.45
resetMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected