}
}
-static void removeAllocation(void *addr) {
+static void removeAllocation(void *addr, int overwrite_with_aa) {
Allocated *prev, *a;
if (addr == NULL) {
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;
stg_exit(EXIT_INTERNAL_ERROR);
}
#if defined(DEBUG)
- removeAllocation(p);
+ removeAllocation(p, 0);
addAllocation(space, n2);
#endif
return space;
stgFree(void* p)
{
#if defined(DEBUG)
- removeAllocation(p);
+ removeAllocation(p, 1);
#endif
free(p);
}
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;
Get the current time as a string. Used in profiling reports.
-------------------------------------------------------------------------- */
-#if defined(PROFILING) || defined(DEBUG) || defined(PAR) || defined(GRAN)
char *
time_str(void)
{
}
return nowstr;
}
-#endif
/* -----------------------------------------------------------------------------
* Reset a file handle to blocking mode. We do this for the standard