From b15cc6cadea920bb80849ef07fa72622b1a75b69 Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 13 Nov 2009 19:26:44 +0000 Subject: [PATCH] don't call Mem_CheckSentinelsGlobal in image loaders (wastes time) call Mem_CheckSentinelsGlobal every frame if developer_memorydebug cvar is on (or MEMPARANOIA is on) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9482 d7cf8633-e32d-0410-b094-e92efae38249 --- host.c | 3 +++ image.c | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/host.c b/host.c index a5bca736..1f2ccaa4 100644 --- a/host.c +++ b/host.c @@ -935,6 +935,9 @@ void Host_Main(void) #if MEMPARANOIA Mem_CheckSentinelsGlobal(); +#else + if (developer_memorydebug.integer) + Mem_CheckSentinelsGlobal(); #endif // if there is some time remaining from this frame, reset the timers diff --git a/image.c b/image.c index 968fabf6..2f805795 100644 --- a/image.c +++ b/image.c @@ -852,8 +852,8 @@ unsigned char *loadimagepixelsbgra (const char *filename, qboolean complain, qbo imageformat_t *firstformat, *format; unsigned char *f, *data = NULL; char basename[MAX_QPATH], name[MAX_QPATH], *c; - if (developer_memorydebug.integer) - Mem_CheckSentinelsGlobal(); + //if (developer_memorydebug.integer) + // Mem_CheckSentinelsGlobal(); if (developer_texturelogging.integer) Log_Printf("textures.log", "%s\n", filename); Image_StripImageExtension(filename, basename, sizeof(basename)); // strip filename extensions to allow replacement by other types @@ -894,8 +894,8 @@ unsigned char *loadimagepixelsbgra (const char *filename, qboolean complain, qbo { if (developer.integer >= 10) Con_Printf("loaded image %s (%dx%d)\n", name, image_width, image_height); - if (developer_memorydebug.integer) - Mem_CheckSentinelsGlobal(); + //if (developer_memorydebug.integer) + // Mem_CheckSentinelsGlobal(); if(allowFixtrans && r_fixtrans_auto.integer) { int n = fixtransparentpixels(data, image_width, image_height); @@ -931,8 +931,8 @@ unsigned char *loadimagepixelsbgra (const char *filename, qboolean complain, qbo // texture loading can take a while, so make sure we're sending keepalives CL_KeepaliveMessage(false); - if (developer_memorydebug.integer) - Mem_CheckSentinelsGlobal(); + //if (developer_memorydebug.integer) + // Mem_CheckSentinelsGlobal(); return NULL; } -- 2.39.2