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

Method Free

trinity/Tr2SuballocatedBuffer.cpp:65–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65void 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
85void Tr2SuballocatedBuffer::ReleaseResources( TriStorage s )
86{

Callers 2

ReleaseResourcesMethod · 0.45
~AllocationMethod · 0.45

Calls 3

GetAllocatedMemoryMethod · 0.80
beginFunction · 0.70
endFunction · 0.70

Tested by

no test coverage detected