Re: MAXIMUM_ALIGNOF on Windows-32 - Mailing list pgsql-hackers

From Tom Lane
Subject Re: MAXIMUM_ALIGNOF on Windows-32
Date
Msg-id 4216.1184939506@sss.pgh.pa.us
Whole thread Raw
In response to MAXIMUM_ALIGNOF on Windows-32  ("Pavan Deolasee" <pavan.deolasee@gmail.com>)
Responses Re: MAXIMUM_ALIGNOF on Windows-32  (Andrew Dunstan <andrew@dunslane.net>)
Re: MAXIMUM_ALIGNOF on Windows-32  ("Pavan Deolasee" <pavan.deolasee@gmail.com>)
List pgsql-hackers
"Pavan Deolasee" <pavan.deolasee@gmail.com> writes:
> The MAXIMUM_ALIGNOF value is set to 8 bytes in a Windows- 32-bit
> environment. I have very little knowledge about Windows, but at
> the face of it, this looks strange. Any idea why is this required ?

It's not entirely unreasonable.  The same thing happens on HPPA,
which is nominally a 32-bit architecture but the hardware requires
8-byte alignment of doubles (and maybe int64 too, I forget).
On newer Intel hardware it'd make sense to pad to avoid misaligned
fetches.

Anyway, we detect this directly based on the C compiler's behavior,
and you can't argue with the compiler about it.  Whatever it's
doing is right by definition.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Memory leak in vac_update_relstats ?
Next
From: Andrew Dunstan
Date:
Subject: Re: MAXIMUM_ALIGNOF on Windows-32