This is the mail archive of the libc-alpha@sourceware.org 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]

Re: Improving math function wrappers


On 03/16/2017 02:52 PM, Wilco Dijkstra wrote:
While the wrappers may be bypassed when building with -Ofast, this uses C header
magic (ie. it doesn't work in languages other than C and C++). Given other languages
don't even have the concept of errno, C99 doesn't require it, and no application ever
reads errno, it is inefficient to force the use of the wrappers in almost all cases.

What's the expensive part? Computing what errno value to set, or obtaining the location of errno?

We have recently removed the PID cache from the TCB. We could store the errno value there, instead of going through __errno_location. (Code outside glibc would still use __errno_location, of course.)

Florian


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