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 v2] handle sem_t with ILP32 and __HAVE_64B_ATOMICS


On 1/28/2015 4:04 AM, Torvald Riegel wrote:
I thing using to_new_sem in all cases is cleaner, but my comment on the
union wasn't quite right.  I agree the union should give the proper
alignment, because it includes struct new_sem directly, so will pick up
the uint64_t alignment of it.

I have reverted the code to just using the union, which on balance I
think I slightly prefer.  I think mentioning to_new_sem() in the comment
as part of the explanation is a sufficient way to deal with this.

+      /* Create the initial file content.  The union forces the
+         alignment of initsem to be at least as much as newsem.
+         When to_new_sem() provides for varying internal alignment,
+         this expression makes the alignment zero, and matches the
+         eventual alignment when the union is copied to the start of
+         an mmap'ed file page.  */

--
Chris Metcalf, EZChip Semiconductor
http://www.ezchip.com


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