Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5faead3

Browse files
committed
Remove overzeleous assertions in pg_atomic_flag code.
The atomics code asserts proper alignment in various places. That'smainly because the alignment of 64bit integers is not sufficient foratomic operations on all platforms. Some ABIs only have four bytealignment, but don't have atomic behavior when crossing pageboundaries.The flags code isn't affected by that however, as the type alignmentalways is sufficient for atomic operations. Nevertheless the codeasserted alignment requirements. Before8c3debb it was only broken onhppa, 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.usBackpatch: 9.5-
1 parent1f3bbe0 commit5faead3

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

‎src/include/port/atomics.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@
173173
staticinlinevoid
174174
pg_atomic_init_flag(volatilepg_atomic_flag*ptr)
175175
{
176-
AssertPointerAlignment(ptr,sizeof(*ptr));
177-
178176
pg_atomic_init_flag_impl(ptr);
179177
}
180178

@@ -188,8 +186,6 @@ pg_atomic_init_flag(volatile pg_atomic_flag *ptr)
188186
staticinlinebool
189187
pg_atomic_test_set_flag(volatilepg_atomic_flag*ptr)
190188
{
191-
AssertPointerAlignment(ptr,sizeof(*ptr));
192-
193189
returnpg_atomic_test_set_flag_impl(ptr);
194190
}
195191

@@ -203,8 +199,6 @@ pg_atomic_test_set_flag(volatile pg_atomic_flag *ptr)
203199
staticinlinebool
204200
pg_atomic_unlocked_test_flag(volatilepg_atomic_flag*ptr)
205201
{
206-
AssertPointerAlignment(ptr,sizeof(*ptr));
207-
208202
returnpg_atomic_unlocked_test_flag_impl(ptr);
209203
}
210204

@@ -216,8 +210,6 @@ pg_atomic_unlocked_test_flag(volatile pg_atomic_flag *ptr)
216210
staticinlinevoid
217211
pg_atomic_clear_flag(volatilepg_atomic_flag*ptr)
218212
{
219-
AssertPointerAlignment(ptr,sizeof(*ptr));
220-
221213
pg_atomic_clear_flag_impl(ptr);
222214
}
223215

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp