projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
55dd028
)
Give a better panic if the allocation debugger is used uninitialised
author
Ian Lynagh
<igloo@earth.li>
Wed, 13 Dec 2006 12:26:02 +0000
(12:26 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Wed, 13 Dec 2006 12:26:02 +0000
(12:26 +0000)
rts/RtsUtils.c
patch
|
blob
|
history
diff --git
a/rts/RtsUtils.c
b/rts/RtsUtils.c
index
a8efe79
..
518d464
100644
(file)
--- 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;
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 */
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;
static void removeAllocation(void *addr) {
Allocated *prev, *a;
+ if (allocs == NULL) {
+ barf("addAllocation: allocator debugger not initialised");
+ }
if (addr == NULL) {
barf("Freeing NULL!");
}
if (addr == NULL) {
barf("Freeing NULL!");
}