Fix the Windows "VirtualAlloc MEM_COMMIT failed" bug
authorIan Lynagh <igloo@earth.li>
Wed, 6 Sep 2006 11:27:50 +0000 (11:27 +0000)
committerIan Lynagh <igloo@earth.li>
Wed, 6 Sep 2006 11:27:50 +0000 (11:27 +0000)
We had
    base=01100000 size=1048576 size_delta=0 it->size=2097152
    it->base=00F00000 base-it->base=00200000
in commitBlocks.
Esa Ilari Vuokko identified this inequality test as the cause.

rts/MBlock.c

index c886fd5..85fe02d 100644 (file)
@@ -442,7 +442,7 @@ static void
 commitBlocks(char* base, int size) {
     alloc_rec* it;
     it=allocs;
-    for( ; it!=0 && (it->base+it->size)<base; it=it->next ) {}
+    for( ; it!=0 && (it->base+it->size)<=base; it=it->next ) {}
     for( ; it!=0 && size>0; it=it->next ) {
         int size_delta;
         void* temp;