MCPcopy Create free account
hub / github.com/beefytech/Beef / CleanupHotHeap

Method CleanupHotHeap

IDEHelper/DebugTarget.cpp:293–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293void DebugTarget::CleanupHotHeap()
294{
295 //TODO: We have more work to do before this catches all the required cases
296 return;
297
298 bool hadRemovals = false;
299 for (int dwarfIdx = 0; dwarfIdx < (int)mDbgModules.size(); dwarfIdx++)
300 {
301 DbgModule* dbgModule = mDbgModules[dwarfIdx];
302 if (dbgModule->IsObjectFile())
303 {
304 if (!mHotHeap->IsReferenced(dbgModule->mImageBase, dbgModule->mImageSize))
305 {
306 Beefy::OutputDebugStrF("Clearing hot module %p data from %@ to %@\n", dbgModule, dbgModule->mImageBase, dbgModule->mImageBase + dbgModule->mImageSize);
307
308 BfLogDbg("Unloading hot idx: %s@%d\n", dbgModule->mFilePath.c_str(), dbgModule->mHotIdx);
309 dbgModule->mDeleting = true;
310 dbgModule->RemoveTargetData();
311 hadRemovals = true;
312 }
313 }
314 }
315
316 if (hadRemovals)
317 {
318 RemoveTargetData();
319 for (int dwarfIdx = 0; dwarfIdx < (int)mDbgModules.size(); dwarfIdx++)
320 {
321 DbgModule* dbgModule = mDbgModules[dwarfIdx];
322 if (dbgModule->mDeleting)
323 {
324 ClearFindDbgModuleCache();
325 mDbgModules.RemoveAt(dwarfIdx);
326 bool success = mDbgModuleMap.Remove(dbgModule->mId);
327 BF_ASSERT_REL(success);
328 delete dbgModule;
329 dwarfIdx--;
330 }
331 }
332 }
333}
334
335void DebugTarget::RehupSrcFiles()
336{

Callers

nothing calls this directly

Calls 7

IsObjectFileMethod · 0.80
IsReferencedMethod · 0.80
sizeMethod · 0.45
c_strMethod · 0.45
RemoveTargetDataMethod · 0.45
RemoveAtMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected