- Notifications
You must be signed in to change notification settings - Fork28
Commit698127a
committed
Prefer int-wide pg_atomic_flag over char-wide when using gcc intrinsics.
configure can only probe the existence of gcc intrinsics, not how wellthey're implemented, and unfortunately the answer is sometimes "badly".In particular we've found that multiple compilers fail to implementchar-width __sync_lock_test_and_set() correctly on PPC; and even a correctimplementation would necessarily be pretty inefficient, since that hardwarehas only a word-wide primitive to work with.Given the knowledge we've accumulated in s_lock.h, it appears that it'sbest to rely on int-width TAS operations on most non-Intel architectures.Hence, pick int not char when both are nominally available to us ingeneric-gcc.h (note that that code is not used for x86[_64]).Back-patch to fix regression test failures on FreeBSD/PPC. Ordinarilyback-patching a change like this would be verboten because of ABI breakage.But since pg_atomic_flag is not yet used in any Postgres data structure,there's no ABI to break. It seems safer to back-patch to avoid possiblegotchas, if someday we do back-patch something that uses pg_atomic_flag.Discussion:https://postgr.es/m/25414.1483076673@sss.pgh.pa.us1 parent345b2dc commit698127a
1 file changed
+8
-5
lines changedLines changed: 8 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
62 | 62 |
| |
63 | 63 |
| |
64 | 64 |
| |
65 |
| - | |
66 |
| - | |
67 |
| - | |
68 |
| - | |
69 |
| - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
70 | 71 |
| |
| 72 | + | |
| 73 | + | |
71 | 74 |
| |
72 | 75 |
| |
73 | 76 |
| |
|
0 commit comments
Comments
(0)