MCPcopy Create free account
hub / github.com/carbonengine/trinity / ReleaseResources

Method ReleaseResources

trinity/Tr2SuballocatedBuffer.cpp:85–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85void Tr2SuballocatedBuffer::ReleaseResources( TriStorage s )
86{
87 if( ( s & TRISTORAGE_MANAGEDMEMORY ) != 0 )
88 {
89 m_buffer = Tr2BufferAL();
90
91 for( auto& allocation : m_allocations )
92 {
93 m_allocator.Free( allocation->m_allocation );
94 allocation->m_parent = nullptr;
95 }
96
97 m_allocations.clear();
98
99 CCP_STATS_SET( suballocatedBufferAllocated, m_allocator.GetAllocatedMemory() );
100 }
101}
102
103bool Tr2SuballocatedBuffer::OnPrepareResources()
104{

Callers

nothing calls this directly

Calls 3

GetAllocatedMemoryMethod · 0.80
Tr2BufferALClass · 0.50
FreeMethod · 0.45

Tested by

no test coverage detected