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: [[PATCH RFC 2] 02/63] Y2038: add function __difftime64


On Tue, 12 Jun 2018, Albert ARIBAUD wrote:

> When a 64-bit time implementation needs to translate back to 32-bit
> times before calling to the kernel, would it not be counter-productive
> to make the 32-bit interface a wrapper around it? This would hit the
> 32-bit client code with two conversions (from the 32-bit interface
> to the 64-bit implementation, and from the implementation to the 32-
> bit kernel syscall) when the original 32-bit interface would make none
> and call the kernel (as) directly (as possible).

If you're calling into the kernel, the cost of conversions is negligible.  
Even if you aren't calling into the kernel it's still a very small cost (a 
few instructions).  Increased code size from duplicate implementations 
also has a performance cost from increased cache usage.  And the interests 
of maintainability of glibc code point very strongly to having single 
implementations using 64-bit times, and thin wrappers round them for 
32-bit times - especially for complicated code such as some of the 
pthreads functions.

-- 
Joseph S. Myers
joseph@codesourcery.com


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