This is the mail archive of the mailing list for the glibc 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]

replacing nested functions "findidx" with non-nested.


The glibc code has two header files, locale/weight.h and locale/weightwc.h,
that define a body of a local function "findidx" and that are later
included here:

Both functions are declared as "auto inline int32_t __attribute
so they are force-inlined by the compiler into ~18 call sites.

I would like to un-nest these functions
and will need your advice on how to do that.

One option is to leave the functions defined in their header files and
change them
to "static inline int32_t __attribute ((always_inline))".
This will have minimal impact on the generated code and the patch will me small.

Another option is to move the function bodies into a .c file (e.g.
This way findidx will not get inlined but we will save on code size.
On x86_64 linux the file size saving for libc.a is about 75Kb (0.3%).

Which would be more preferable?
I've attached two draft patches (not ready for detailed review, but
they should give the feeling)

Thanks in advance,


Attachment: findidx-large.txt
Description: Text document

Attachment: findidx-small.txt
Description: Text document

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