This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FW: [PATCH][STEP 2] ctype changes for removing locale structures


On Fri, 2018-02-09 at 19:09 +0100, Jaap de Wolff wrote:
> In basic the intention of my patches is to make to memory footprint
> for embedded environment small.
> I talked about locale, and a part of the locale definition is a
> lookup table with the characteristics of each character.
> Of course it is possible to move the lookup table outside the locale,
> but then the lookup table still takes 257 bytes of memory.
> 
> In the beginning my intention was just to move the __global_locale
> table from ram to rom, and a reaction was that that was not enough
> when using embedded processors with 2K or even 1K of ROM and 128
> bytes of RAM.
> 
> I do think that for the intended users of the REENT_SMALL computation
> speed (efficiency) is less important as memory.
> So I replaces all usage of a lookup table by a (kind of) computation.

I use REENT_SMALL on pretty decent ARM microcontrollers, so I would not
 fit that description. Anyway - your change won't work with a chip that
has 128 bytes of memory anyway, as small reent would take ~95% of it. I
don't think a chip that has 1 or 2 kB of flash and 128 bytes of RAM is
a good target for writing firmware in C using a generic library like
newlib. If newlib will try to please everybody, finally it won't be
good for anyone...

I'm for some sort of configurable locale removal, so I have nothing
against this particular patches, just don't make reent-small something
that is slow an inefficient. For me reent-small is about the amount of
RAM used, not speed - a difference between ~1 kB vs ~110 bytes is quite
significant, especially if you actually need almost nothing from reent,
even more so in case of multithreaded apps...

Regards,
FCh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]