]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Made Mem_PrintStats also print the real allocated size (including structures used...
authormolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 18 Sep 2005 16:36:14 +0000 (16:36 +0000)
committermolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 18 Sep 2005 16:36:14 +0000 (16:36 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5724 d7cf8633-e32d-0410-b094-e92efae38249

zone.c

diff --git a/zone.c b/zone.c
index 0f1678d8dcc0c53ca4e14a4451d254fc09ed306c..ced5e82e37f99c767bf87193a9e7dcaea3d486fc 100644 (file)
--- a/zone.c
+++ b/zone.c
@@ -383,7 +383,7 @@ mempool_t *zonemempool;
 
 void Mem_PrintStats(void)
 {
-       size_t count = 0, size = 0;
+       size_t count = 0, size = 0, realsize = 0;
        mempool_t *pool;
        memheader_t *mem;
        Mem_CheckSentinelsGlobal();
@@ -391,8 +391,10 @@ void Mem_PrintStats(void)
        {
                count++;
                size += pool->totalsize;
+               realsize += pool->realsize;
        }
        Con_Printf("%lu memory pools, totalling %lu bytes (%.3fMB)\n", (unsigned long)count, (unsigned long)size, size / 1048576.0);
+       Con_Printf("total allocated size: %lu bytes (%.3fMB)\n", (unsigned long)realsize, realsize / 1048576.0);
        for (pool = poolchain;pool;pool = pool->next)
        {
                if ((pool->flags & POOLFLAG_TEMP) && pool->chain)