| 63 | } |
| 64 | |
| 65 | void b2StackAllocator::Free(void* p) |
| 66 | { |
| 67 | b2Assert(m_entryCount > 0); |
| 68 | b2StackEntry* entry = m_entries + m_entryCount - 1; |
| 69 | b2Assert(p == entry->data); |
| 70 | if (entry->usedMalloc) |
| 71 | { |
| 72 | b2Free(p); |
| 73 | } |
| 74 | else |
| 75 | { |
| 76 | m_index -= entry->size; |
| 77 | } |
| 78 | m_allocation -= entry->size; |
| 79 | --m_entryCount; |
| 80 | |
| 81 | p = nullptr; |
| 82 | } |
| 83 | |
| 84 | int32 b2StackAllocator::GetMaxAllocation() const |
| 85 | { |
no test coverage detected