Re: [PATCH v2] mem-pool: Don't assume uintmax_t is aligned enough for all types
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 23, 2022, 20:28 UTC
- Message-ID
- <xmqqo8428ae6.fsf@gitster.g>
- In-Reply-To
- <FD089F0E-C826-4A8E-BC16-F763E256B410@jrtc27.com>
Jessica Clarke <jrtc27@jrtc27.com> writes:
Show 5 quoted lines
> So, sizeof(X) does not always equal _Alignof(X), even for primitive > types, _Alignof need only be a factor of sizeof. The two are the same > on most architectures, and is a sensible ABI, but the exception is the > m68k case I was referring to above. On m68k, sizeof(long long) == 8, > but _Alignof(long long) == 2 (yes this is a real pain point of its ABI;
Ah, thanks. Having a variant of the above explanation in a comment next to the "union within a struct" would help future readers from asking the same question as I asked.