How to disable per-local string functions?

Hans-Bernhard Bröker HBBroeker@t-online.de
Tue Mar 21 00:12:00 GMT 2017


Am 20.03.2017 um 13:33 schrieb Philip Munts:
> On 03/20/2017 11:58 AM, Corinna Vinschen wrote:
>> On Mar 19 08:24, Philip Munts wrote:

> tolower() and isupper() both must be getting inlined.

Close, but not quite.  Like most of <ctype.h>'s public interfaces 
typically are, they're macros.  So they generate in-line code by 
definition, not by inlining or optimization.

They do however refer to locale-specific tables to find properties of 
given characters.  Those tables are managed by the <locale.h> machinery. 
  That's the __locale_ctype_ptr you see in your assembly listing.  And 
yes, that will drag in a large part, if not all, of the locale 
implementation without anyone having much of a choice about it.  By 
definition of Standard C the <ctype.h> functions are locale-sensitive, 
after all.

The only way to avoid all the memory consumption that goes with this 
would be to build the library with support for the 'C' locale only.  I 
don't think there's a configure-time option for that.



More information about the Newlib mailing list