With the new non-contiguous ROM linker (and, eventually, the WonderWitch target's use of SRAM for data storage), it is viable to add limited support for dynamic memory allocation and have it not be entirely useless. sbrk() would be a good first step.
The non-contiguous linker could be adjusted to allocate the heap and stack in separate "gaps" on user request to maximize the benefit of this, for example placing the stack in 0x0040 - 0x0FFF and the heap in 0xC000 - 0xFDFF.
With the new non-contiguous ROM linker (and, eventually, the WonderWitch target's use of SRAM for data storage), it is viable to add limited support for dynamic memory allocation and have it not be entirely useless.
sbrk()
would be a good first step.The non-contiguous linker could be adjusted to allocate the heap and stack in separate "gaps" on user request to maximize the benefit of this, for example placing the stack in
0x0040 - 0x0FFF
and the heap in0xC000 - 0xFDFF
.