summaryrefslogtreecommitdiff
path: root/Libraries/LibC/stdlib.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibC/stdlib.cpp')
-rw-r--r--Libraries/LibC/stdlib.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Libraries/LibC/stdlib.cpp b/Libraries/LibC/stdlib.cpp
index 8fd6d975b3..7c930a2722 100644
--- a/Libraries/LibC/stdlib.cpp
+++ b/Libraries/LibC/stdlib.cpp
@@ -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);