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 2/2] Use C11 _Alignas on scratch_buffer internal buffer


Florian Weimer wrote:
Sorry, didn't know that. We could use 1056-byte buffers instead; would that be the same on all glibc platforms? I'm not sure how important it is that the byte count be the same everywhere.

I've chased ghosts due to such buffer size differences.  I'd like to reduce it to the 32/64 difference if possible.

Then Andreas's suggestion is a good way to go. A member like this in struct scratch_buffer:

  union { max_align_t __a; char __c[1024]; } __space;

and then use __space.__c everywhere the code currently uses __space. This will make the buffer size 1024 on all platforms where sizeof (max_align_t) <= 1024, which should be a safe assumption for all glibc platforms now.


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