Question about the Heap - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Help & Support (https://www.boriel.com/forum/forumdisplay.php?fid=16) +---- Thread: Question about the Heap (/showthread.php?tid=465) |
Question about the Heap - LCD - 05-30-2012 Hi Boriel, just following easy question: If I use a heap of 256 bytes, where it is put into memory? I want to know where I cannot put any binary data. Is this 65535-heapsize? Edit: May this be problematic if I page the heap out? Is there a possibility that we can put the heap at a selected memory area (e.g. a buffer created with DEFB's) at program start (I know that changing it may crash the program). Re: Question about the Heap - boriel - 05-30-2012 If you dump your code into asm (--asm), you will see the HEAP is defined JUST after your program. Look for: Code: ZXBASIC_MEM_HEAP: There are many things that can be done, e.g.:
Re: Question about the Heap - LCD - 05-30-2012 Excellent, thank you! I try to avoid strings and work with memory pointer in my 128K games. As I do not need much strings, reducing heap and allocating it at a different address is a option. The Printer buffer is large enough, but in 128K BASIC there are system variables stored. With these informations I'm sure I canfind a solution. Re: Question about the Heap - boriel - 05-30-2012 I've not finished the "Memory Map" Option yet, but 256 heap bytes might be enough for printing strings for example. Also you can swap pages for a while with a routine, do something (not using strings) and swap them back and this should work :?: Re: Question about the Heap - LCD - 05-30-2012 boriel Wrote:Also you can swap pages for a while with a routine, do something (not using strings) and swap them back and this should work :?:This is the most likely option for me at moment. I'm even sure, I won't use more than 68 bytes in heap. 4700 Bytes is a absolute overkill. |