From 265ac23f6e60751a4fcae404e129a4f78e95f7a4 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 28 Dec 2016 13:05:16 +0000 Subject: [PATCH] Restore 4*Unit heap allocation multiple. --- src/runtime/Heap.Mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index f01b9c7b..a3392fa8 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -270,7 +270,7 @@ MODULE Heap; IF firstTry THEN GC(TRUE); INC(blksz, Unit); (* Anti-thrashing heuristics: ensure 1/5 of the heap will not be allocated. *) - t := S.LSH(allocated + blksz, -2) (*uDIV 4*) * 5 ; (* Minimum preferred heapsize *) + t := S.LSH(allocated + blksz, -(ldUnit+2)) (*uDIV 4*Unit*) * (5*Unit) ; (* Minimum preferred heapsize *) IF uLT(heapsize, t) THEN ExtendHeap(t - heapsize) END; firstTry := FALSE; new := NEWREC(tag); IF new = NIL THEN (* Heap is 1/5 free but fragmentation prevented allocation *)