"Not enough heap memory"
| Author | Message | ||||
| bfwolf Senior Member Joined: 03/01/2025 Location: GermanyPosts: 243 |
I've been thinking about your dilemma regarding RAM usage, and the following idea came to me: Why not consider a directive that allows you to control RAM priority from within the program? In other words, make the priority of using fast internal RAM and slow QSPI RAM controllable for subsequent DIM commands? This could be done e.g. using an OPTION that would be valid for all DIM commands until the "opposite" OPTION is used. For example: OPTION RAMPRIORITY [FASTRAM | SLOWRAM] Instead of controlling it via OPTION, you could also introduce true directives, similar to how it's done in Turbo Pascal/Delphi: through a "special syntax" of comments. This would have the advantage of being compatible with other BASIC dialects. I did some research: The FreeBasic compiler also does something similar using "meta-commands" that begin with the 2-character-sequence '$ . I assume that FreeBasic additionally expects the sequence '$ to be at the beginning of a line (i.e. the first non-whitespace position). https://www.freebasic.net/wiki/CatPgCompilerSwitches There are then meta-commands like '$DYNAMIC, '$LANG, etc. Following this scheme, one could, for example, introduce the meta-commands '$RAMPRIORITY FASTRAM and '$RAMPRIORITY SLOWRAM in MMBasic. I wouldn't bring the term PSRAM into this context, because that would be too specifically tailored to microcontrollers with PSRAM. And slow external RAMs with different interfaces are also common in other controllers. How do you think about it? Regards, bfwolf. |
||||