pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Remove bogus assertion in pg_atomic_monotonic_advance_u64
2+ messages / 1 participants
[nested] [flat]

* pgsql: Remove bogus assertion in pg_atomic_monotonic_advance_u64
@ 2024-07-04 11:35 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Alvaro Herrera @ 2024-07-04 11:35 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Remove bogus assertion in pg_atomic_monotonic_advance_u64

This code wanted to ensure that the 'exchange' variable passed to
pg_atomic_compare_exchange_u64 has correct alignment, but apparently
platforms don't actually require anything that doesn't come naturally.

While messing with pg_atomic_monotonic_advance_u64: instead of using
Max() to determine the value to return, just use
pg_atomic_compare_exchange_u64()'s return value to decide; also, use
pg_atomic_compare_exchange_u64 instead of the _impl version; also remove
the unnecessary underscore at the end of variable name "target".

Backpatch to 17, where this code was introduced by commit bf3ff7bf83bc.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://postgr.es/m/36796438-a718-cf9b-2071-b2c1b947c1b5@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/768f0c3e21b31f92ebb510a7e4d0c2cd1c1ecb97

Modified Files
--------------
src/include/port/atomics.h                | 17 ++++++-----------
src/include/port/atomics/arch-ppc.h       |  2 ++
src/include/port/atomics/arch-x86.h       |  2 ++
src/include/port/atomics/generic-gcc.h    |  3 +++
src/include/port/atomics/generic-sunpro.h |  1 +
5 files changed, 14 insertions(+), 11 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Remove bogus assertion in pg_atomic_monotonic_advance_u64
@ 2024-07-04 11:35 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Alvaro Herrera @ 2024-07-04 11:35 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Remove bogus assertion in pg_atomic_monotonic_advance_u64

This code wanted to ensure that the 'exchange' variable passed to
pg_atomic_compare_exchange_u64 has correct alignment, but apparently
platforms don't actually require anything that doesn't come naturally.

While messing with pg_atomic_monotonic_advance_u64: instead of using
Max() to determine the value to return, just use
pg_atomic_compare_exchange_u64()'s return value to decide; also, use
pg_atomic_compare_exchange_u64 instead of the _impl version; also remove
the unnecessary underscore at the end of variable name "target".

Backpatch to 17, where this code was introduced by commit bf3ff7bf83bc.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://postgr.es/m/36796438-a718-cf9b-2071-b2c1b947c1b5@gmail.com

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3a9d0d774d90c41bd60a8fb85685092d3e0bc30f

Modified Files
--------------
src/include/port/atomics.h                | 17 ++++++-----------
src/include/port/atomics/arch-ppc.h       |  2 ++
src/include/port/atomics/arch-x86.h       |  2 ++
src/include/port/atomics/generic-gcc.h    |  3 +++
src/include/port/atomics/generic-sunpro.h |  1 +
5 files changed, 14 insertions(+), 11 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-07-04 11:35 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-07-04 11:35 pgsql: Remove bogus assertion in pg_atomic_monotonic_advance_u64 Alvaro Herrera <alvherre@alvh.no-ip.org>
2024-07-04 11:35 pgsql: Remove bogus assertion in pg_atomic_monotonic_advance_u64 Alvaro Herrera <alvherre@alvh.no-ip.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox