diff --git a/avr/modules/heap/main.asm b/avr/modules/heap/main.asm index 3dfb7c6..529a996 100644 --- a/avr/modules/heap/main.asm +++ b/avr/modules/heap/main.asm @@ -244,10 +244,10 @@ Heap_Free: st X+, r24 ; write chunk footer st X+, r25 ; X points to the next chunk header now 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 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 Heap_Free_dblFree: lds r24, heapDblFree @@ -361,6 +361,7 @@ heapUseChunk_split: heapUseChunk_directAlloc: ld r17, -X ; load allocated size from chunk header ld r16, -X + andi r16, 0xfc ; mask off lower two bits mov r18, r16 sbr r18, (1<