forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9713c06
committed
Change the declaration of struct varlena so that the length word is
represented as "char ...[4]" not "int32". Since the length word is neversupposed to be accessed via this struct member anyway, this won't breakany existing code that is following the rules. The advantage is that Ccompilers will no longer assume that a pointer to struct varlena isword-aligned, which prevents incorrect optimizations in TOAST-pointeraccess and perhaps other places. gcc doesn't seem to do this (at leastnot at -O2), but the problem is demonstrable on some other compilers.I changed struct inet as well, but didn't bother to touch a lot of otherstruct definitions in which it wouldn't make any difference because therewere other fields forcing int alignment anyway. Hopefully none of thosestruct definitions are used for accessing unaligned Datums.1 parent870993e commit9713c06
File tree
4 files changed
+29
-14
lines changed- doc/src/sgml
- src
- backend/access/heap
- include
- utils
4 files changed
+29
-14
lines changedLines changed: 22 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
219 | 219 |
| |
220 | 220 |
| |
221 | 221 |
| |
222 |
| - | |
| 222 | + | |
223 | 223 |
| |
224 | 224 |
| |
225 | 225 |
| |
| |||
240 | 240 |
| |
241 | 241 |
| |
242 | 242 |
| |
243 |
| - | |
244 |
| - | |
245 |
| - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
246 | 246 |
| |
247 | 247 |
| |
248 | 248 |
| |
249 | 249 |
| |
250 |
| - | |
251 |
| - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
252 | 253 |
| |
253 | 254 |
| |
254 | 255 |
| |
| |||
265 | 266 |
| |
266 | 267 |
| |
267 | 268 |
| |
268 |
| - | |
| 269 | + | |
| 270 | + | |
269 | 271 |
| |
270 | 272 |
| |
271 | 273 |
| |
272 | 274 |
| |
273 | 275 |
| |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
274 | 288 |
| |
275 | 289 |
| |
276 | 290 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
65 | 65 |
| |
66 | 66 |
| |
67 | 67 |
| |
68 |
| - | |
| 68 | + | |
| 69 | + | |
69 | 70 |
| |
70 | 71 |
| |
71 | 72 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 |
| - | |
| 15 | + | |
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| |||
410 | 410 |
| |
411 | 411 |
| |
412 | 412 |
| |
413 |
| - | |
| 413 | + | |
414 | 414 |
| |
415 | 415 |
| |
416 | 416 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
52 |
| - | |
| 52 | + | |
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
|
0 commit comments
Comments
(0)