mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:38:11 +00:00
malloc: Keep some stats and dump them at process exit if LIBC_DUMP_MALLOC_STATS is set
Very bare-bones and barely useful. Can go away once the perf_event-based malloc tracking is further along.
This commit is contained in:
parent
c44d2515b4
commit
22f701d657
3 changed files with 72 additions and 2 deletions
|
@ -201,6 +201,10 @@ extern "C" {
|
|||
void exit(int status)
|
||||
{
|
||||
__cxa_finalize(nullptr);
|
||||
|
||||
if (getenv("LIBC_DUMP_MALLOC_STATS"))
|
||||
serenity_dump_malloc_stats();
|
||||
|
||||
extern void _fini();
|
||||
_fini();
|
||||
fflush(stdout);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue