Re: [cc65] HEAP from here to there

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2009-06-05 23:54:25
On Thu, Jun 04, 2009 at 08:51:29PM -0400, Greg King wrote:
> His description is what I had in mind when I put that "HEAP:" line in the
> LD65 configure files.  But, Uz pointed out that my idea would have problems
> on platforms that must copy the stack-pointer, at run-time, from system
> variables (Apple2, Atari, and Pet, for example).  He left "HEAP:" in those
> files because he planned to move the heap constructor out of the common part
> of the library, and into the platform-specific part of the library.  Then,
> we could use the configure-file method on platforms that allow it.

Thanks for reminding me. Moving the heap module into the platform directories
may be unnecessary, if we can get rid of the initialization code, because the
variables can be changed easily by the startup code for special needs. Because
this is even possible today and even for user programs, there's no urgent need
for a general solution in the config file. But when considering such a
solution, I have to admit that I don't like the idea of using segments that
contain nothing just to use the automatically generated start and end
addresses. Using symbols in the config file as Oliver did is an easier
solution and - provided that linker defined addresses can be used, which I
will have to check - more straightforward.

On Fri, Jun 05, 2009 at 01:53:32PM -0400, Greg King wrote:
> I think that my way is both more difficult, and easier, to customize.  If a
> programmer wanted to force the heap to sit between two absolute addresses,
> then your style is easier to edit.  But, if one wanted to put a
> specially-named segment between the BSS and the heap, then my style would
> let one simply insert that segment's line into the configure-file --
> nothing else would need to be changed.

This is also true for Olivers solution if __RAM_LAST__ is used, because this
value adjusts automatically, if you place another segment in the RAM memory
area.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Jun 5 23:57:32 2009

This archive was generated by hypermail 2.1.8 : 2009-06-05 23:57:33 CEST