From 2342052bc34fed96bfc7e269f0c1fc3ddd891cf6 Mon Sep 17 00:00:00 2001 From: cuz Date: Wed, 5 Jan 2005 20:06:13 +0000 Subject: [PATCH] Slice blocks even if the remainder is just sizeof(freeblock) bytes in size. git-svn-id: svn://svn.cc65.org/cc65/trunk@3345 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/common/malloc.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsrc/common/malloc.s b/libsrc/common/malloc.s index c1157a223..0f22090bb 100644 --- a/libsrc/common/malloc.s +++ b/libsrc/common/malloc.s @@ -214,7 +214,7 @@ TakeFromTop: BlockFound: bne SliceBlock ; Block is large enough to slice - cpx #HEAP_MIN_BLOCKSIZE+1 ; Check low byte + cpx #HEAP_MIN_BLOCKSIZE ; Check low byte bcs SliceBlock ; Jump if block is large enough to slice ; The block is too small to slice it. Use the block in full. The block @@ -309,7 +309,7 @@ SliceBlock: stx ptr2 sta ptr2+1 -; Fill the size and start address into the admin space of the block +; Fill the size and start address into the admin space of the block ; (struct usedblock) and return the user pointer FillSizeAndRet: -- 2.39.5