mirror of
https://github.com/RGBCube/serenity
synced 2025-07-02 23:22:07 +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:
parent
7e13244238
commit
f6584bfc36
4 changed files with 78 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue