avr: re-enable heapCoalecseUp

This commit is contained in:
Martin Preuss
2026-05-10 17:03:13 +02:00
parent 6787b4f527
commit 85a837d9ef

View File

@@ -244,10 +244,10 @@ Heap_Free:
st X+, r24 ; write chunk footer st X+, r24 ; write chunk footer
st X+, r25 ; X points to the next chunk header now st X+, r25 ; X points to the next chunk header now
rcall heapAdjustStatsFree ; update stats (r16, r17) rcall heapAdjustStatsFree ; update stats (r16, r17)
; rcall heapCoalecseUp ; try to coalecse following chunk with this (r16, r17, r24, r25, X) rcall heapCoalecseUp ; try to coalecse following chunk with this (r16, r17, r24, r25, X)
pop xh pop xh
pop xl pop xl
; rcall heapCoalecseUp ; try to coalesce this chunk with predecessor (r16, r17, r24, r25, X) rcall heapCoalecseUp ; try to coalesce this chunk with predecessor (r16, r17, r24, r25, X)
rjmp Heap_Free_ret rjmp Heap_Free_ret
Heap_Free_dblFree: Heap_Free_dblFree:
lds r24, heapDblFree lds r24, heapDblFree
@@ -361,6 +361,7 @@ heapUseChunk_split:
heapUseChunk_directAlloc: heapUseChunk_directAlloc:
ld r17, -X ; load allocated size from chunk header ld r17, -X ; load allocated size from chunk header
ld r16, -X ld r16, -X
andi r16, 0xfc ; mask off lower two bits
mov r18, r16 mov r18, r16
sbr r18, (1<<HEAP_HEADER_BIT_USED) sbr r18, (1<<HEAP_HEADER_BIT_USED)
st X, r18 ; set USED bit in chunk header st X, r18 ; set USED bit in chunk header