Re: [cc65] HEAP from here to there

From: Ullrich von Bassewitz <>
Date: 2009-05-27 14:34:16

On Tue, May 26, 2009 at 11:27:27PM +0200, Thomas Giesel wrote:
> A look into _heap.s makes me think that the heap if from the end of BSS
> to the beginning of the stack.

That is true.

> Shouldn't the segment HEAP used for
> the start of the heap?

Maybe, but in most cases this solution is less flexible. The problem is that
there are two growing areas, heap and stack. If you make them distinct, each
area needs to have some safety overhead. In the choosen scenario (which is
rather common on most platforms), both can grow and a safety area is shared by
both, which reduces overall memory needs.

> Is "HEAP: ... define=yes" and replacing "__BSS_START__ + __BSS_SIZE___"
> with "__HEAP_START__" in _heap.s the right fix?

Either this, or include _heap.h and set the variables at the beginning of



Ullrich von Bassewitz                        
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Wed May 27 14:35:57 2009

This archive was generated by hypermail 2.1.8 : 2009-05-27 14:35:59 CEST