postgresql/src/include/port
Andres Freund 20fd90febc Avoid need for valgrind suppressions for pg_atomic_init_u64 on some platforms.
Previously we used pg_atomic_write_64_impl inside
pg_atomic_init_u64. That works correctly, but on platforms without
64bit single copy atomicity it could trigger spurious valgrind errors
about uninitialized memory, because we use compare_and_swap for atomic
writes on such platforms.

I previously suppressed one instance of this problem (6c878edc1d),
but as Tom reports that wasn't enough. As the atomic variable cannot
yet be concurrently accessible during initialization, it seems better
to have pg_atomic_init_64_impl set the value directly.

Change pg_atomic_init_u32_impl for symmetry.

Reported-By: Tom Lane
Author: Andres Freund
Discussion: https://postgr.es/m/1714601.1591503815@sss.pgh.pa.us
Backpatch: 9.5-
2020-06-08 20:03:09 -07:00
..
atomics Avoid need for valgrind suppressions for pg_atomic_init_u64 on some platforms. 2020-06-08 20:03:09 -07:00
win32 Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
win32_msvc Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
aix.h Attempt to work around a 32bit xlc compiler bug from a different place. 2015-08-08 01:19:02 +02:00
atomics.h Remove overzeleous assertions in pg_atomic_flag code. 2018-04-07 18:30:15 -07:00
cygwin.h Remove checks for now long outdated compilers. 2012-09-28 19:43:50 -04:00
darwin.h Refer to OS X as "macOS", except for the port name which is still "darwin". 2016-09-25 15:40:57 -04:00
freebsd.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
hpux.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
linux.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
netbsd.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
openbsd.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
pg_bswap.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
pg_crc32c.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
solaris.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
win32.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00