summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEsa Ilari Vuokko <ei@vuokko.info>2006-08-30 18:55:40 +0000
committerEsa Ilari Vuokko <ei@vuokko.info>2006-08-30 18:55:40 +0000
commitdb76a303650647c24a9a3f998dbe66e1d1623a1c (patch)
treee3b60d9a00c9d75eac665fc96f2a2909923638e8
parent47f59de5d2f5e7573dbf4a335d52da9fa1c3e23d (diff)
downloadhaskell-db76a303650647c24a9a3f998dbe66e1d1623a1c.tar.gz
Fix Windows MBlock alloctor bookkeeping bug
-rw-r--r--rts/MBlock.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/rts/MBlock.c b/rts/MBlock.c
index 9058205716..edde679992 100644
--- a/rts/MBlock.c
+++ b/rts/MBlock.c
@@ -340,16 +340,16 @@ allocNew(nat n) {
sysErrorBelch(
"getMBlocks: VirtualAlloc MEM_RESERVE %d blocks failed", n);
} else {
- if(allocs==0) {
- allocs=rec;
- rec->next=0;
- } else {
- alloc_rec* it;
- it=allocs;
- for(; it->next!=0 && it->next->base<rec->base; it=it->next) ;
- rec->next=it->next;
- it->next=rec;
- }
+ alloc_rec temp;
+ temp.base=0; temp.size=0; temp.next=allocs;
+
+ alloc_rec* it;
+ it=&temp;
+ for(; it->next!=0 && it->next->base<rec->base; it=it->next) ;
+ rec->next=it->next;
+ it->next=rec;
+
+ allocs=temp.next;
debugTrace(DEBUG_gc, "allocated %d megablock(s) at 0x%x",n,(nat)rec->base);
}
return rec;