- Notifications
You must be signed in to change notification settings - Fork28
Commitac883ac
committed
Fix shm_toc.c to always return buffer-aligned memory.
Previously, if you passed a non-aligned size to shm_toc_create(), thememory returned by shm_toc_allocate() would be similarly non-aligned.This was exposed by commit3cda10f, which allocated structs containinga pg_atomic_uint64 field with shm_toc_allocate(). On systems withMAXIMUM_ALIGNOF = 4, such structs still need to be 8-bytes aligned, butthe memory returned by shm_toc_allocate() was only 4-bytes aligned.It's quite bogus that we abuse BUFFERALIGN to align the structs forpg_atomic_uint64. It doesn't really have anything to do with buffers. Butthat's a separate issue.This ought to fix the buildfarm failures on 32-bit x86 systems.Discussion:https://www.postgresql.org/message-id/7e0a73a5-0df9-1859-b8ae-9acf122dc38d@iki.fi1 parent4395f7d commitac883ac
2 files changed
+20
-5
lines changedLines changed: 19 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
44 | 44 |
| |
45 | 45 |
| |
46 | 46 |
| |
47 |
| - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
48 | 53 |
| |
49 | 54 |
| |
50 | 55 |
| |
| |||
88 | 93 |
| |
89 | 94 |
| |
90 | 95 |
| |
91 |
| - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
92 | 102 |
| |
93 | 103 |
| |
94 | 104 |
| |
| |||
252 | 262 |
| |
253 | 263 |
| |
254 | 264 |
| |
255 |
| - | |
256 |
| - | |
257 |
| - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
258 | 272 |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
598 | 598 |
| |
599 | 599 |
| |
600 | 600 |
| |
| 601 | + | |
601 | 602 |
| |
602 | 603 |
| |
603 | 604 |
| |
|
0 commit comments
Comments
(0)