aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2018-04-07 18:27:14 -0700
committerAndres Freund <andres@anarazel.de>2018-04-07 18:30:15 -0700
commitd234602c28e8e1baea342602dbb404cee9fde47e (patch)
treef73b70020808a2eeb0f751d4da4fb9025141a292
parent2b74022473f0c7a7fbe11a4973f80478226275bd (diff)
downloadpostgresql-d234602c28e8e1baea342602dbb404cee9fde47e.tar.gz
postgresql-d234602c28e8e1baea342602dbb404cee9fde47e.zip
Remove overzeleous assertions in pg_atomic_flag code.
The atomics code asserts proper alignment in various places. That's mainly because the alignment of 64bit integers is not sufficient for atomic operations on all platforms. Some ABIs only have four byte alignment, but don't have atomic behavior when crossing page boundaries. The flags code isn't affected by that however, as the type alignment always is sufficient for atomic operations. Nevertheless the code asserted alignment requirements. Before 8c3debbb it was only broken on hppa, after it probably affect further platforms. Thus remove the assertions for pg_atomic_flag operators. Per buildfarm animal pademelon. Discussion: https://postgr.es/m/7223.1523124425@sss.pgh.pa.us Backpatch: 9.5-
-rw-r--r--src/include/port/atomics.h8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/include/port/atomics.h b/src/include/port/atomics.h
index 8c825bd9261..04703916755 100644
--- a/src/include/port/atomics.h
+++ b/src/include/port/atomics.h
@@ -174,8 +174,6 @@
static inline void
pg_atomic_init_flag(volatile pg_atomic_flag *ptr)
{
- AssertPointerAlignment(ptr, sizeof(*ptr));
-
pg_atomic_init_flag_impl(ptr);
}
@@ -189,8 +187,6 @@ pg_atomic_init_flag(volatile pg_atomic_flag *ptr)
static inline bool
pg_atomic_test_set_flag(volatile pg_atomic_flag *ptr)
{
- AssertPointerAlignment(ptr, sizeof(*ptr));
-
return pg_atomic_test_set_flag_impl(ptr);
}
@@ -204,8 +200,6 @@ pg_atomic_test_set_flag(volatile pg_atomic_flag *ptr)
static inline bool
pg_atomic_unlocked_test_flag(volatile pg_atomic_flag *ptr)
{
- AssertPointerAlignment(ptr, sizeof(*ptr));
-
return pg_atomic_unlocked_test_flag_impl(ptr);
}
@@ -217,8 +211,6 @@ pg_atomic_unlocked_test_flag(volatile pg_atomic_flag *ptr)
static inline void
pg_atomic_clear_flag(volatile pg_atomic_flag *ptr)
{
- AssertPointerAlignment(ptr, sizeof(*ptr));
-
pg_atomic_clear_flag_impl(ptr);
}