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: [RFC] Should we declare errno with __thread on x86?


On 03/18/2016 10:42 PM, H.J. Lu wrote:
errno is defined in glibc as an TLS variable on x86,  Shouldn't we
declare it as

extern __thread int errno;

instead of

#   define errno (*__errno_location ())

to avoid function call overhead?

Considering that errno is mostly accessed on error paths, I think more compact code is better. It's not obvious that TLS variable access is a win in all cases according to that metric.

Florian


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