Release previously allocated memory.
| 92 | |
| 93 | // Release previously allocated memory. |
| 94 | void 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 |
| 109 | void SingleFrameAllocator::reset() { |
no outgoing calls
no test coverage detected