postgresql/src/include/port
Andres Freund de4a259896 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:02:49 -07:00
..
atomics Avoid need for valgrind suppressions for pg_atomic_init_u64 on some platforms. 2020-06-08 20:02:49 -07:00
win32 Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
win32_msvc Assume that we have utime() and <utime.h>. 2020-02-21 14:30:47 -05: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 Update copyrights for 2020 2020-01-01 12:21:45 -05:00
cygwin.h Cygwin and Mingw floating-point fixes. 2019-02-16 01:50:16 +00: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_bitutils.h Modify various power 2 calculations to use new helper functions 2020-04-08 16:55:03 +12:00
pg_bswap.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pg_crc32c.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
solaris.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
win32.h Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
win32_port.h Assume that we have utime() and <utime.h>. 2020-02-21 14:30:47 -05:00