04-27-2012, 07:05 AM
slenkar Wrote:maybe module writers could specify if the module is written for speed or size,and make 2 versions+1 :!:
ah dunno
In fact, these can be done already using #IFDEF
e.g. We could create an ID like OPT_MEM or OPT_SIZE, and do something like:
Code:
...
#ifdef OPT_MEM
...
// Code for memory optimization goes here
...
#else
...
// Code for speed optimization goes here
...
#endif
#define OPT_MEM at the beginning, using a flag like --opt=mem or --opt=size,
or much simpler: the programmer can insert a #define OPT_MEM at the beginning of the code.
This could be very handy for things like:
- FP routines (using routines provided by Britlion, for example, instead of ROM ones).
- Using ROM drawing & printing primitives (CLS, PRINT, DRAW, PLOT, CIRCLE)