diff options
| author | Ian Lynagh <igloo@earth.li> | 2006-12-13 12:26:02 +0000 |
|---|---|---|
| committer | Ian Lynagh <igloo@earth.li> | 2006-12-13 12:26:02 +0000 |
| commit | 55476c33f7389b8d0d8def117b3b2c5833663a79 (patch) | |
| tree | bd50182a1d70ee13e698cb0af3deddbbc32ae59b | |
| parent | 55dd028c1dc41c603316dbe843fa13c1cac30720 (diff) | |
| download | haskell-55476c33f7389b8d0d8def117b3b2c5833663a79.tar.gz | |
Give a better panic if the allocation debugger is used uninitialised
| -rw-r--r-- | rts/RtsUtils.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/rts/RtsUtils.c b/rts/RtsUtils.c index a8efe7928e..518d464040 100644 --- a/rts/RtsUtils.c +++ b/rts/RtsUtils.c @@ -95,6 +95,9 @@ static void addAllocation(void *addr, size_t len) { Allocated *a; size_t alloc_size; + if (allocs == NULL) { + barf("addAllocation: allocator debugger not initialised"); + } alloc_size = sizeof(Allocated); if ((a = (Allocated *) malloc(alloc_size)) == NULL) { /* don't fflush(stdout); WORKAROUND bug in Linux glibc */ @@ -112,6 +115,9 @@ static void addAllocation(void *addr, size_t len) { static void removeAllocation(void *addr) { Allocated *prev, *a; + if (allocs == NULL) { + barf("addAllocation: allocator debugger not initialised"); + } if (addr == NULL) { barf("Freeing NULL!"); } |
