From f29fba2c8392ccd88f83c1cf6482d144a2651d23 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Fri, 10 May 2013 12:56:31 +0200 Subject: [PATCH] InfoPanel: Added display of memory fragmentation information This information is displayed only when debug mode was enabled to avoid confusing users. --- src/dialog.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/dialog.c b/src/dialog.c index 6f1950f1..2c2e5d3f 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -1244,8 +1244,22 @@ void wShowInfoPanel(WScreen * scr) { struct mallinfo ma = mallinfo(); snprintf(buffer, sizeof(buffer), - _("Total memory allocated: %i kB (in use: %i kB).\n"), - (ma.arena + ma.hblkhd) / 1024, (ma.uordblks + ma.hblkhd) / 1024); +#ifdef DEBUG + _("Total memory allocated: %i kB (in use: %i kB, %d free chunks).\n"), +#else + _("Total memory allocated: %i kB (in use: %i kB).\n"), +#endif + (ma.arena + ma.hblkhd) / 1024, + (ma.uordblks + ma.hblkhd) / 1024 +#ifdef DEBUG + /* + * This information is representative of the memory + * fragmentation. In ideal case it should be 1, but + * that is never possible + */ + , ma.ordblks +#endif + ); strbuf = wstrappend(strbuf, buffer); } -- 2.11.4.GIT