1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 04:20:27 +01:00

InfoPanel: Added display of memory fragmentation information

This information is displayed only when debug mode was enabled to
avoid confusing users.
This commit is contained in:
Christophe CURIS
2013-05-10 12:56:31 +02:00
committed by Carlos R. Mafra
parent c253c5a7c7
commit f29fba2c83

View File

@@ -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);
}