]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
speed up leaktest a bit
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 1 Nov 2011 12:22:57 +0000 (12:22 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 1 Nov 2011 12:22:57 +0000 (12:22 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11510 d7cf8633-e32d-0410-b094-e92efae38249

prvm_edict.c

index 5168b597566c225c2dd54cfd56d46022be2c31a4..e60c14d4c516a7e563882cb03d7941378ab7235f 100644 (file)
@@ -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)