Fix race saving/restoring malloc hooks by going back to overriding malloc, etc., plus some additional cleanup. b=392009 r+a1.9=brendan

This commit is contained in:
2007-09-28 15:39:59 -07:00
parent eb52ad70c4
commit ec7f25b1f6
2 changed files with 172 additions and 123 deletions

View File

@@ -121,6 +121,7 @@ void __cdecl dhw_free( void* p )
DHW_ORIGINAL(FREE_, getFreeHooker())(p);
PRUint32 end = PR_IntervalNow();
--t->suppress_tracing;
/* FIXME bug 392008: We could race with reallocation of p. */
FreeCallback(p, start, end, t);
}
@@ -140,6 +141,7 @@ void * __cdecl dhw_realloc(void * pin, size_t size)
void* pout = DHW_ORIGINAL(REALLOC_, getReallocHooker())(pin, size);
PRUint32 end = PR_IntervalNow();
--t->suppress_tracing;
/* FIXME bug 392008: We could race with reallocation of pin. */
ReallocCallback(pin, pout, size, start, end, t);
return pout;
}