]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
added developer_memorydebug cvar (does CheckSentinelsGlobal on all Mem_Alloc calls)
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 21 Jun 2003 11:05:32 +0000 (11:05 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 21 Jun 2003 11:05:32 +0000 (11:05 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3090 d7cf8633-e32d-0410-b094-e92efae38249

zone.c

diff --git a/zone.c b/zone.c
index 196324375527c9e48170c890c0180366323116e5..21b0fb060e500f746ed98ff010cd940d672d0d50 100644 (file)
--- a/zone.c
+++ b/zone.c
@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "quakedef.h"
 
 cvar_t developer_memory = {0, "developer_memory", "0"};
 #include "quakedef.h"
 
 cvar_t developer_memory = {0, "developer_memory", "0"};
+cvar_t developer_memorydebug = {0, "developer_memorydebug", "0"};
 
 mempool_t *poolchain = NULL;
 
 
 mempool_t *poolchain = NULL;
 
@@ -38,6 +39,8 @@ void *_Mem_Alloc(mempool_t *pool, int size, const char *filename, int fileline)
                Sys_Error("Mem_Alloc: pool == NULL (alloc at %s:%i)", filename, fileline);
        if (developer.integer && developer_memory.integer)
                Con_Printf("Mem_Alloc: pool %s, file %s:%i, size %i bytes\n", pool->name, filename, fileline, size);
                Sys_Error("Mem_Alloc: pool == NULL (alloc at %s:%i)", filename, fileline);
        if (developer.integer && developer_memory.integer)
                Con_Printf("Mem_Alloc: pool %s, file %s:%i, size %i bytes\n", pool->name, filename, fileline, size);
+       if (developer.integer && developer_memorydebug.integer)
+               _Mem_CheckSentinelsGlobal(filename, fileline);
        pool->totalsize += size;
 #if MEMCLUMPING
        if (size < 4096)
        pool->totalsize += size;
 #if MEMCLUMPING
        if (size < 4096)
@@ -407,5 +410,6 @@ void Memory_Init_Commands (void)
        Cmd_AddCommand ("memstats", MemStats_f);
        Cmd_AddCommand ("memlist", MemList_f);
        Cvar_RegisterVariable (&developer_memory);
        Cmd_AddCommand ("memstats", MemStats_f);
        Cmd_AddCommand ("memlist", MemList_f);
        Cvar_RegisterVariable (&developer_memory);
+       Cvar_RegisterVariable (&developer_memorydebug);
 }
 
 }