Type of memory advantage of the nano printf and malloc versions

R. Diez rdiezmail-newlib@yahoo.de
Thu May 13 16:54:00 GMT 2021


Hi all:

Regarding the nano version of printf etc:

----8<----8<----8<----
-enable-newlib-nano-formatted-io

This builds NEWLIB with a special implementation of formatted I/O
functions, designed to lower the size of application on small systems
  with size constraint issues.
----8<----8<----8<----

I am guessing that this affects program space (ROM/flash), but not RAM usage, is that correct? I am not using stdio etc, only sprintf and the like.


Regarding the nano version of malloc:

----8<----8<----8<----
--enable-newlib-nano-malloc

NEWLIB has two implementations of malloc family's functions, one in
`mallocr.c' and the other one in `nano-mallocr.c'.  This options
enables the nano-malloc implementation, which is for small systems
with very limited memory.
----8<----8<----8<----

I am guessing that this affects mainly program space (ROM/flash), but does it need less RAM too? Much less, or a little less?

I have one target with 8 KiB, but another one with more than 80 KiB RAM. Given that the nano malloc currently has memory fragmentation issues, if I 
have understood the last, recent discussion about it correctly, I wonder whether the nano malloc makes sense if the target has plenty of ROM/flash 
memory, which is the case on my boards.

Thanks in advance,
   rdiez


More information about the Newlib mailing list