mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 21:08:08 +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:
committed by
Carlos R. Mafra
parent
c253c5a7c7
commit
f29fba2c83
16
src/dialog.c
16
src/dialog.c
@@ -1244,8 +1244,22 @@ void wShowInfoPanel(WScreen * scr)
|
|||||||
{
|
{
|
||||||
struct mallinfo ma = mallinfo();
|
struct mallinfo ma = mallinfo();
|
||||||
snprintf(buffer, sizeof(buffer),
|
snprintf(buffer, sizeof(buffer),
|
||||||
|
#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"),
|
_("Total memory allocated: %i kB (in use: %i kB).\n"),
|
||||||
(ma.arena + ma.hblkhd) / 1024, (ma.uordblks + ma.hblkhd) / 1024);
|
#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);
|
strbuf = wstrappend(strbuf, buffer);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user