X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=rts%2FRtsUtils.c;h=94c357e5ba6aa7ed347d3a0fe97893d9aeb0c6d5;hp=a2a291970241c70355f786a5ffccd8d0a0c5754f;hb=2eb04ca0f8d0ec72b417cddc60672c696b4a3daa;hpb=4307b489da14ddd13c85fe837c5f27bf991c312e diff --git a/rts/RtsUtils.c b/rts/RtsUtils.c index a2a2919..94c357e 100644 --- a/rts/RtsUtils.c +++ b/rts/RtsUtils.c @@ -136,7 +136,7 @@ static void addAllocation(void *addr, size_t len) { } } -static void removeAllocation(void *addr) { +static void removeAllocation(void *addr, int overwrite_with_aa) { Allocated *prev, *a; if (addr == NULL) { @@ -150,7 +150,9 @@ static void removeAllocation(void *addr) { while (a != NULL) { if (a->addr == addr) { prev->next = a->next; - memset(addr, 0xaa, a->len); + if (overwrite_with_aa) { + memset(addr, 0xaa, a->len); + } free(a); RELEASE_LOCK(&allocator_mutex); return; @@ -210,7 +212,7 @@ stgReallocBytes (void *p, int n, char *msg) stg_exit(EXIT_INTERNAL_ERROR); } #if defined(DEBUG) - removeAllocation(p); + removeAllocation(p, 0); addAllocation(space, n2); #endif return space; @@ -239,7 +241,7 @@ void stgFree(void* p) { #if defined(DEBUG) - removeAllocation(p); + removeAllocation(p, 1); #endif free(p); } @@ -296,14 +298,14 @@ nat stg_strlen(char *s) ToDo: put this somewhere sensible. ------------------------------------------------------------------------- */ -static I_ __GenSymCounter = 0; +static HsInt __GenSymCounter = 0; -I_ +HsInt genSymZh(void) { return(__GenSymCounter++); } -I_ +HsInt resetGenSymZh(void) /* it's your funeral */ { __GenSymCounter=0; @@ -314,7 +316,6 @@ resetGenSymZh(void) /* it's your funeral */ Get the current time as a string. Used in profiling reports. -------------------------------------------------------------------------- */ -#if defined(PROFILING) || defined(DEBUG) || defined(PAR) || defined(GRAN) char * time_str(void) { @@ -333,7 +334,6 @@ time_str(void) } return nowstr; } -#endif /* ----------------------------------------------------------------------------- * Reset a file handle to blocking mode. We do this for the standard