Fix alignment of pg_atomic_uint64 variables on some 32bit platforms.
authorAndres Freund <andres@anarazel.de>
Sun, 11 Jan 2015 00:06:37 +0000 (01:06 +0100)
committerAndres Freund <andres@anarazel.de>
Sun, 11 Jan 2015 00:06:37 +0000 (01:06 +0100)
commitdb4ec2ffce3549225619cae51d828224a11a165f
treeba4c002e0eeeae7c47ea84700fe4c9b9b6f6a992
parent62f5e447fd09074d82052a7232822d1e80d25a08
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ć.
src/include/port/atomics/arch-x86.h
src/include/port/atomics/generic-acc.h
src/include/port/atomics/generic-gcc.h
src/include/port/atomics/generic-msvc.h
src/include/port/atomics/generic-sunpro.h
src/include/port/atomics/generic-xlc.h