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: How to disable per-local string functions?


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.


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