| 63 | } |
| 64 | |
| 65 | void Tr2SuballocatedBuffer::Free( Allocation& allocation ) |
| 66 | { |
| 67 | if( allocation.m_parent ) |
| 68 | { |
| 69 | auto found = find( begin( m_allocations ), end( m_allocations ), &allocation ); |
| 70 | if( found != end( m_allocations ) ) |
| 71 | { |
| 72 | m_allocator.Free( allocation.m_allocation ); |
| 73 | allocation.m_parent = nullptr; |
| 74 | |
| 75 | m_allocations.erase( found ); |
| 76 | CCP_STATS_SET( suballocatedBufferAllocated, m_allocator.GetAllocatedMemory() ); |
| 77 | } |
| 78 | else |
| 79 | { |
| 80 | CCP_LOGERR( "Memory corruption in Tr2SuballocatedBuffer::Free()! Trying to free an allocation that has already been freed!" ); |
| 81 | } |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | void Tr2SuballocatedBuffer::ReleaseResources( TriStorage s ) |
| 86 | { |
no test coverage detected