diff --git a/src/include/port/atomics/generic.h b/src/include/port/atomics/generic.h index d3ba89a58f..d60a0d9e7f 100644 --- a/src/include/port/atomics/generic.h +++ b/src/include/port/atomics/generic.h @@ -160,7 +160,7 @@ pg_atomic_clear_flag_impl(volatile pg_atomic_flag *ptr) static inline void pg_atomic_init_u32_impl(volatile pg_atomic_uint32 *ptr, uint32 val_) { - pg_atomic_write_u32_impl(ptr, val_); + ptr->value = val_; } #endif @@ -330,7 +330,7 @@ pg_atomic_read_u64_impl(volatile pg_atomic_uint64 *ptr) static inline void pg_atomic_init_u64_impl(volatile pg_atomic_uint64 *ptr, uint64 val_) { - pg_atomic_write_u64_impl(ptr, val_); + ptr->value = val_; } #endif diff --git a/src/tools/valgrind.supp b/src/tools/valgrind.supp index acdb6206dd..e3a179d210 100644 --- a/src/tools/valgrind.supp +++ b/src/tools/valgrind.supp @@ -134,20 +134,6 @@ fun:IsBinaryCoercible } -# Atomic writes to 64bit atomic vars uses compare/exchange to -# guarantee atomic writes of 64bit variables. pg_atomic_write is used -# during initialization of the atomic variable; that leads to an -# initial read of the old, undefined, memory value. But that's just to -# make sure the swap works correctly. -{ - uninitialized_atomic_init_u64 - Memcheck:Cond - fun:pg_atomic_exchange_u64_impl - fun:pg_atomic_write_u64_impl - fun:pg_atomic_init_u64_impl -} - - # Python's allocator does some low-level tricks for efficiency. Those # can be disabled for better instrumentation; but few people testing # postgres will have such a build of python. So add broad