Re: [cc65] _heapremove() RFE

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2005-02-15 13:30:17
Hi!

On Tue, Feb 15, 2005 at 11:40:42AM +0100, MagerValp wrote:
> Is there a way to get the linker (and heap) to use ram below $4000 and
> above $7fff, but leave that range untouched (for graphics)?

Not, if you want the linker to automagically distribute code into more than
one memory area. Oliver (and a few others) have already requested this
feature, and I admit that it is useful, but it's more work than just a day or
so.

My answer regarding _heapremove() assumed that part of one memory area should
get excluded from the heap, but not that it should get used for code.

Instead of

    RAM: start = $7FF, size = $c801, define = yes, file = %O;

    ...

    _heapremove ((void*)0xA000, 0x1000);

one could use

    RAM: start = $7FF, size = $9801, define = yes, file = %O;

    ...

    _heapadd ((void*)0xB000, 0x2000);

While the former can fail if heap blocks have already been allocated, the
latter cannot.

> In my
> current projects I've had to put some code into "hicode" segments, and
> so on, but it's clunky to have to micromanage it like that.

Yes, I know. I have done that myself. Since adding automatic distribution to
the linker is a bigger task, Oliver suggested to generate a map file even in
case of a memory area overflow, to help with manual distribution. This is
already implemented in the snapshot. It's not the same as automatic
distribution, but at least a small improvement.

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 Tue Feb 15 13:30:21 2005

This archive was generated by hypermail 2.1.8 : 2005-02-15 13:30:33 CET