[PATCH] Reduce RAM usage of floating point conversion functions
Freddie Chopin
freddie_chopin@op.pl
Mon Jun 10 09:29:00 GMT 2013
W dniu 2013-06-10 11:12, Federico Terraneo pisze:
> I did think about that, but this moves 256 bytes of .bss to 256 bytes
> of .rodata, i.e. it would take up that amount of FLASH on a
> microcontroller, and the table is mostly filled with zeros, which
> still seems a waste.
> Here is a patch that goes in that direction:
> if PREFER_SIZE_OVER_SPEED, __OPTIMIZE_SIZE__ or _SMALL_HEXDIG are
> defined, the table is still replaced with a function, otherwise the
> table is made const (but not static, since it's used also in another
> file). In this way in both cases 256 bytes of RAM are saved, and in
> the former also 256 bytes of FLASH.
Great!
But one thing - is the patch correct? You define a macro
__check_hexdig(), and in the code you use __get_hexdig(), which I cannot
find.
BTW - could you check what's the size of the new function you introduced
(__hexdig_fun())? If it's not smaller than this 256B array than this is
not a size optimization (;
4\/3!!
More information about the Newlib
mailing list