forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5dc692f
committed
Ensure proper alignment of tuples in HashMemoryChunkData buffers.
The previous coding relied (without any documentation) on the data[]member of HashMemoryChunkData being at a MAXALIGN'ed offset. If itwas not, the tuples would not be maxaligned either, leading to failureson alignment-picky machines. While there seems to be no live bug on anyplatform we support, this is clearly pretty fragile: any addition to orrearrangement of the fields in HashMemoryChunkData could break it.Let's remove the hazard by getting rid of the data[] member and insteadusing pointer arithmetic with an explicitly maxalign'ed offset.Discussion:https://postgr.es/m/14483.1514938129@sss.pgh.pa.us1 parent54eff53 commit5dc692f
2 files changed
+24
-22
lines changedLines changed: 15 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
979 | 979 |
| |
980 | 980 |
| |
981 | 981 |
| |
982 |
| - | |
| 982 | + | |
983 | 983 |
| |
984 | 984 |
| |
985 | 985 |
| |
| |||
1285 | 1285 |
| |
1286 | 1286 |
| |
1287 | 1287 |
| |
1288 |
| - | |
| 1288 | + | |
1289 | 1289 |
| |
1290 | 1290 |
| |
1291 | 1291 |
| |
| |||
1469 | 1469 |
| |
1470 | 1470 |
| |
1471 | 1471 |
| |
1472 |
| - | |
| 1472 | + | |
1473 | 1473 |
| |
1474 | 1474 |
| |
1475 | 1475 |
| |
| |||
1552 | 1552 |
| |
1553 | 1553 |
| |
1554 | 1554 |
| |
1555 |
| - | |
| 1555 | + | |
1556 | 1556 |
| |
1557 | 1557 |
| |
1558 | 1558 |
| |
| |||
2651 | 2651 |
| |
2652 | 2652 |
| |
2653 | 2653 |
| |
2654 |
| - | |
2655 |
| - | |
| 2654 | + | |
2656 | 2655 |
| |
2657 | 2656 |
| |
2658 | 2657 |
| |
2659 | 2658 |
| |
2660 | 2659 |
| |
2661 |
| - | |
| 2660 | + | |
2662 | 2661 |
| |
2663 |
| - | |
2664 |
| - | |
| 2662 | + | |
| 2663 | + | |
2665 | 2664 |
| |
2666 | 2665 |
| |
2667 | 2666 |
| |
| |||
2678 | 2677 |
| |
2679 | 2678 |
| |
2680 | 2679 |
| |
2681 |
| - | |
2682 |
| - | |
2683 |
| - | |
2684 |
| - | |
| 2680 | + | |
2685 | 2681 |
| |
2686 | 2682 |
| |
2687 | 2683 |
| |
| |||
2693 | 2689 |
| |
2694 | 2690 |
| |
2695 | 2691 |
| |
2696 |
| - | |
| 2692 | + | |
2697 | 2693 |
| |
2698 | 2694 |
| |
2699 | 2695 |
| |
| |||
2702 | 2698 |
| |
2703 | 2699 |
| |
2704 | 2700 |
| |
2705 |
| - | |
| 2701 | + | |
2706 | 2702 |
| |
2707 | 2703 |
| |
2708 | 2704 |
| |
2709 |
| - | |
| 2705 | + | |
2710 | 2706 |
| |
2711 | 2707 |
| |
2712 | 2708 |
| |
| |||
2751 | 2747 |
| |
2752 | 2748 |
| |
2753 | 2749 |
| |
2754 |
| - | |
| 2750 | + | |
2755 | 2751 |
| |
2756 | 2752 |
| |
2757 | 2753 |
| |
| |||
2859 | 2855 |
| |
2860 | 2856 |
| |
2861 | 2857 |
| |
2862 |
| - | |
2863 |
| - | |
| 2858 | + | |
| 2859 | + | |
2864 | 2860 |
| |
2865 | 2861 |
| |
2866 | 2862 |
| |
|
Lines changed: 9 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
117 | 117 |
| |
118 | 118 |
| |
119 | 119 |
| |
120 |
| - | |
| 120 | + | |
121 | 121 |
| |
122 | 122 |
| |
123 | 123 |
| |
| |||
127 | 127 |
| |
128 | 128 |
| |
129 | 129 |
| |
130 |
| - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
131 | 135 |
| |
132 | 136 |
| |
133 | 137 |
| |
134 | 138 |
| |
135 | 139 |
| |
136 |
| - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
137 | 143 |
| |
138 | 144 |
| |
139 | 145 |
| |
|
0 commit comments
Comments
(0)