[layers] Stats on memory usage in the Stats screen. Tracks the number and total memory size of the pages (bitmaps) used by layers and their backups. Doesn't count housekeeping costs.

git-svn-id: svn://pulkomandy.tk/GrafX2/branches/layers@1074 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2009-10-13 19:07:58 +00:00
parent 7690cd9e50
commit 2dcc1cf8bd
3 changed files with 39 additions and 5 deletions

11
help.c
View File

@@ -45,6 +45,7 @@
#include "input.h"
#include "hotkeys.h"
#include "errors.h"
#include "pages.h"
// Recherche un raccourci clavier:
word * Shortcut(word shortcut_number)
@@ -637,6 +638,16 @@ void Button_Stats(void)
sprintf(buffer,"%u bytes",(unsigned int)freeRam);
Print_in_window(114,51,buffer,STATS_DATA_COLOR,MC_Black);
// Used memory
Print_in_window(10,59,"Used memory pages: ",STATS_TITLE_COLOR,MC_Black);
if(Stats_pages_memory > (100LL*1024*1024*1024))
sprintf(buffer,"%u (%u Gb)",Stats_pages_number, (unsigned int)(Stats_pages_memory/(1024*1024*1024)));
else if(Stats_pages_memory > (100*1024*1024))
sprintf(buffer,"%u (%u Mb)",Stats_pages_number, (unsigned int)(Stats_pages_memory/(1024*1024)));
else
sprintf(buffer,"%u (%u Kb)",Stats_pages_number, (unsigned int)(Stats_pages_memory/1024));
Print_in_window(162,59,buffer,STATS_DATA_COLOR,MC_Black);
// Affichage de l'espace disque libre
sprintf(buffer,"Free space on %c:",Main_current_directory[0]);
Print_in_window(10,67,buffer,STATS_TITLE_COLOR,MC_Black);