This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Possibility to make __global_locale const to reduce RAM usage?
- From: Damien George <damien dot p dot george at gmail dot com>
- To: newlib at sourceware dot org
- Date: Thu, 19 Oct 2017 12:00:58 +1100
- Subject: Possibility to make __global_locale const to reduce RAM usage?
- Authentication-results: sourceware.org; auth=none
Hello,
As others have already noticed (see
https://sourceware.org/ml/newlib/2017/msg00192.html and
https://sourceware.org/ml/newlib/2017/msg00368.html), since newlib 2.5.0
the locale support pulls in the __global_locale struct which takes around
360 bytes of RAM, which is a lot on a resourced constrained microcontroller.
Would it be possible to make this data structure "const" so that it goes in
.text/.rodata/ROM instead of in .data/RAM? From a brief look at the code
it looks like this structure is usually only ever read from, not written
to, so this may be a possibility.
Best regards,
Damien.