mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-22 23:55:12 +00:00
UserspaceEmulator: Implement very basic leak checking :^)
Upon exit, the emulator will now print a leak report of any malloc allocations that are still live and don't have pointers to their base address anywhere in either another live mallocation, or in one of the non-malloc-block memory regions. Note that the malloc-block memory region check is not fully functional and this will work even better once we get that fixed. This is pretty cool. :^)
This commit is contained in:
@@ -174,6 +174,10 @@ int Emulator::exec()
|
||||
if (trace)
|
||||
m_cpu.dump();
|
||||
}
|
||||
|
||||
if (auto* tracer = malloc_tracer())
|
||||
tracer->dump_leak_report();
|
||||
|
||||
return m_exit_status;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user