MCPcopy Create free account
hub / github.com/SpartanJ/eepp / removePointer

Method removePointer

src/eepp/core/memorymanager.cpp:134–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134bool MemoryManager::removePointer( void* data, const char* file, const size_t& line ) {
135 Lock l( sAllocMutex );
136
137 AllocatedPointerMapIt it = sMapPointers.find( data );
138
139 if ( it == sMapPointers.end() ) {
140 eePRINTL( "Trying to delete pointer %p created that does not exist!", data );
141 eeASSERT( false );
142 return false;
143 }
144
145 if ( it->second.mTrack )
146 eePRINTL( "Deleting pointer %p at '%s' %d", data, file, line );
147
148 sTotalMemoryUsage -= it->second.mMemory;
149
150 sMapPointers.erase( it );
151
152 return true;
153}
154
155size_t MemoryManager::getPeakMemoryUsage() {
156 return sPeakMemoryUsage;

Callers

nothing calls this directly

Calls 4

eePRINTLFunction · 0.85
findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected