From d3b5ddff74ec893a24ba2a72343622b7137ec842 Mon Sep 17 00:00:00 2001 From: divverent Date: Tue, 1 Nov 2011 12:22:57 +0000 Subject: [PATCH] speed up leaktest a bit git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11510 d7cf8633-e32d-0410-b094-e92efae38249 --- prvm_edict.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/prvm_edict.c b/prvm_edict.c index 5168b597..e60c14d4 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -2973,13 +2973,16 @@ static qboolean PRVM_IsEdictReferenced(prvm_prog_t *prog, prvm_edict_t *edict, i if(!*targetname) // "" targetname = NULL; - for (i = 0;i < prog->numglobaldefs;i++) + if(mark == 0) { - ddef_t *d = &prog->globaldefs[i]; - if((etype_t)((int) d->type & ~DEF_SAVEGLOBAL) != ev_entity) - continue; - if(edictnum == PRVM_GLOBALFIELDEDICT(d->ofs)) - return true; + for (i = 0;i < prog->numglobaldefs;i++) + { + ddef_t *d = &prog->globaldefs[i]; + if((etype_t)((int) d->type & ~DEF_SAVEGLOBAL) != ev_entity) + continue; + if(edictnum == PRVM_GLOBALFIELDEDICT(d->ofs)) + return true; + } } for(j = 0; j < prog->num_edicts; ++j) @@ -3082,6 +3085,8 @@ void PRVM_LeakTest(prvm_prog_t *prog) Con_Print("\n"); leaked = true; } + + ed->priv.required->mark = 0; // clear marks again when done } for (i = 0; i < (int)Mem_ExpandableArray_IndexRange(&prog->stringbuffersarray); ++i) -- 2.39.2