mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-01 18:00:26 +00:00
Added memory-information when MEMLEAK is activated.
This commit is contained in:
parent
f7083246cf
commit
0e6ae3da5c
@ -1,5 +1,5 @@
|
|||||||
/* ASE - Allegro Sprite Editor
|
/* ASE - Allegro Sprite Editor
|
||||||
* Copyright (C) 2007 David A. Capello
|
* Copyright (C) 2001-2008 David A. Capello
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -20,7 +20,12 @@
|
|||||||
|
|
||||||
#ifndef USE_PRECOMPILED_HEADER
|
#ifndef USE_PRECOMPILED_HEADER
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <allegro.h>
|
#include <allegro.h>
|
||||||
|
#if defined ALLEGRO_WINDOWS && defined MEMLEAK
|
||||||
|
#include <winalleg.h>
|
||||||
|
#include <psapi.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "jinete/jsystem.h"
|
#include "jinete/jsystem.h"
|
||||||
|
|
||||||
@ -36,6 +41,19 @@ static void cmd_refresh_execute(const char *argument)
|
|||||||
jmouse_show();
|
jmouse_show();
|
||||||
|
|
||||||
app_refresh_screen();
|
app_refresh_screen();
|
||||||
|
|
||||||
|
/* print memory information */
|
||||||
|
#if defined ALLEGRO_WINDOWS && defined MEMLEAK
|
||||||
|
{
|
||||||
|
PROCESS_MEMORY_COUNTERS pmc;
|
||||||
|
if (GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc))) {
|
||||||
|
printf("----\n");
|
||||||
|
printf("current memory: %.16g KB (%lu)\n", pmc.WorkingSetSize / 1024.0, pmc.WorkingSetSize);
|
||||||
|
printf("peak of memory: %.16g KB (%lu)\n", pmc.PeakWorkingSetSize / 1024.0, pmc.PeakWorkingSetSize);
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Command cmd_refresh = {
|
Command cmd_refresh = {
|
||||||
|
Loading…
Reference in New Issue
Block a user