| 105 | } |
| 106 | |
| 107 | void 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 |
nothing calls this directly
no test coverage detected