pgsql: Fix alignment of pg_atomic_uint64 variables on some 32bit platfo - Mailing list pgsql-committers

From Andres Freund
Subject pgsql: Fix alignment of pg_atomic_uint64 variables on some 32bit platfo
Date
Msg-id E1YA6HK-0000Q7-Nw@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix alignment of pg_atomic_uint64 variables on some 32bit platforms.

I failed to recognize that pg_atomic_uint64 wasn't guaranteed to be 8
byte aligned on some 32bit platforms - which it has to be on some
platforms to guarantee the desired atomicity and which we assert.

As this is all compiler specific code anyway we can just rely on
compiler specific tricks to enforce alignment.

I've been unable to find concrete documentation about the version that
introduce the sunpro alignment support, so that might need additional
guards.

I've verified that this works with gcc x86 32bit, but I don't have
access to any other 32bit environment.

Discussion: op.xpsjdkil0sbe7t@vld-kuci

Per report from Vladimir Koković.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/db4ec2ffce3549225619cae51d828224a11a165f

Modified Files
--------------
src/include/port/atomics/arch-x86.h       |    1 +
src/include/port/atomics/generic-acc.h    |    6 ++++++
src/include/port/atomics/generic-gcc.h    |    2 +-
src/include/port/atomics/generic-msvc.h   |    2 +-
src/include/port/atomics/generic-sunpro.h |    8 +++++++-
src/include/port/atomics/generic-xlc.h    |    2 +-
6 files changed, 17 insertions(+), 4 deletions(-)


pgsql-committers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pgsql: Fix documentation template for CREATE TRIGGER.
Next
From: Andres Freund
Date:
Subject: pgsql: Provide a generic fallback for pg_compiler_barrier using an exte