Re: MAXIMUM_ALIGNOF on Windows-32

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: MAXIMUM_ALIGNOF on Windows-32
Date: 2007-07-20 14:22:20
Message-ID: 46A0C51C.10602@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> "Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)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.
>
>
>

Perhaps Pavan is referring to what is hardcoded in pg_config.h.win32
which is used for MSVC builds (but not for MinGW builds, IIRC), in
which case the answer might be that in this file we need to be
pessimistic about such things, since we have no reasonable way to run
configure on this platform.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-07-20 14:32:35 Re: MAXIMUM_ALIGNOF on Windows-32
Previous Message Tom Lane 2007-07-20 13:51:46 Re: MAXIMUM_ALIGNOF on Windows-32