Commit 86fe0712 authored by Jeffrey Lee's avatar Jeffrey Lee Committed by ROOL
Browse files

Fix shrinkables check in AreaGrow

TryToShrinkShrinkables_Bytes expected both R1 and R2 to be byte counts,
but AreaGrow was calling with R1 as a byte count and R2 as a page count.
This would have caused it to request the first-found shrinkable to
shrink more than necessary, and also confuse the rest of AreaGrow when
the page-based R2 result of TryToShrinkShrinkables gets converted to a
byte count (when AreaGrow wants it as a page count)
parent 323e88c6
......@@ -5369,9 +5369,10 @@ AreaGrow ROUT
BHI %FT64 ; we're definitely not doing anything
CMP r2, r1, LSR #12 ; this should definitely set C=0 as required by TryToShrinkShrinkables
Push "lr"
BLCC TryToShrinkShrinkables_Bytes
Pull "lr"
Push "r1,lr"
MOVCC r1, r1, LSR #12
BLCC TryToShrinkShrinkables
Pull "r1,lr"
MOVCS r3, r1 ; if succeeded set r3 to number of bytes to do
BCS %FT65 ; and do it
......@@ -5694,15 +5695,6 @@ TryToShrinkShrinkables ROUT
CMP r2, r1
BCC %BT10 ; if still too small, loop
EXIT ; exit CS indicating success
TryToShrinkShrinkables_Bytes ROUT
MOV r1, r1, LSR #12
MOV r2, r2, LSR #12
BL TryToShrinkShrinkables
MOV r1, r1, LSL #12
MOV r2, r2, LSL #12 ; n.b. may overflow!
; ***********************************************************************************
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment