forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7e3aa03
committed
Reduce size of common allocation header.
The new slab allocator needs different per-allocation information thanthe classical aset.c. The definition in58b25e9 wasn't sufficientlycareful on 32 platforms with 8 byte alignment, leading to buildfarmfailures. That's not entirely easy to fix by just adjusting thedefinition.As slab.c doesn't actually need the size part(s) of the common header,all chunks are equally sized after all, it seems better to insteadreduce the header to the part needed by all allocators, namely whichcontext an allocation belongs to. That has the advantage of reducingthe overhead of slab allocations, and also allows for more flexibilityin future allocators.To avoid spreading the logic about accessing a chunk's context around,centralize it in GetMemoryChunkContext(), which allows to delete agood number of lines.A followup commit will revise the mmgr/README portion aboutStandardChunkHeader, and more.Author: Andres FreundDiscussion:https://postgr.es/m/20170228074420.aazv4iw6k562mnxg@alap3.anarazel.de1 parenteb75f4f commit7e3aa03
File tree
5 files changed
+97
-218
lines changed- src
- backend/utils/mmgr
- include/utils
- tools/pgindent
5 files changed
+97
-218
lines changedLines changed: 22 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
97 | 97 |
| |
98 | 98 |
| |
99 | 99 |
| |
100 |
| - | |
101 |
| - | |
102 |
| - | |
103 |
| - | |
104 |
| - | |
105 |
| - | |
106 |
| - | |
107 |
| - | |
108 |
| - | |
109 |
| - | |
110 |
| - | |
111 |
| - | |
112 |
| - | |
113 |
| - | |
| 100 | + | |
114 | 101 |
| |
115 | 102 |
| |
116 | 103 |
| |
| |||
169 | 156 |
| |
170 | 157 |
| |
171 | 158 |
| |
172 |
| - | |
173 |
| - | |
174 | 159 |
| |
175 | 160 |
| |
176 | 161 |
| |
177 |
| - | |
178 |
| - | |
179 | 162 |
| |
180 | 163 |
| |
181 | 164 |
| |
182 | 165 |
| |
183 | 166 |
| |
184 | 167 |
| |
| 168 | + | |
| 169 | + | |
185 | 170 |
| |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
186 | 178 |
| |
187 | 179 |
| |
188 | 180 |
| |
| |||
334 | 326 |
| |
335 | 327 |
| |
336 | 328 |
| |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
337 | 333 |
| |
338 | 334 |
| |
339 | 335 |
| |
| |||
616 | 612 |
| |
617 | 613 |
| |
618 | 614 |
| |
619 |
| - | |
620 |
| - | |
621 |
| - | |
622 |
| - | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
623 | 619 |
| |
624 |
| - | |
625 |
| - | |
| 620 | + | |
| 621 | + | |
626 | 622 |
| |
627 | 623 |
| |
628 | 624 |
| |
| |||
709 | 705 |
| |
710 | 706 |
| |
711 | 707 |
| |
712 |
| - | |
| 708 | + | |
713 | 709 |
| |
714 | 710 |
| |
715 | 711 |
| |
| |||
799 | 795 |
| |
800 | 796 |
| |
801 | 797 |
| |
802 |
| - | |
| 798 | + | |
803 | 799 |
| |
804 | 800 |
| |
805 | 801 |
| |
|
Lines changed: 8 additions & 113 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
389 | 389 |
| |
390 | 390 |
| |
391 | 391 |
| |
392 |
| - | |
| 392 | + | |
393 | 393 |
| |
394 |
| - | |
395 |
| - | |
396 |
| - | |
397 |
| - | |
398 |
| - | |
399 |
| - | |
400 |
| - | |
401 |
| - | |
402 |
| - | |
403 |
| - | |
404 |
| - | |
405 |
| - | |
406 |
| - | |
407 |
| - | |
408 |
| - | |
409 |
| - | |
410 |
| - | |
411 |
| - | |
412 |
| - | |
413 |
| - | |
414 |
| - | |
415 |
| - | |
416 |
| - | |
417 |
| - | |
418 |
| - | |
419 |
| - | |
420 |
| - | |
421 |
| - | |
422 |
| - | |
423 |
| - | |
424 |
| - | |
425 |
| - | |
426 |
| - | |
427 |
| - | |
428 |
| - | |
429 |
| - | |
430 |
| - | |
431 |
| - | |
432 |
| - | |
433 |
| - | |
434 |
| - | |
435 |
| - | |
436 |
| - | |
437 |
| - | |
438 |
| - | |
439 |
| - | |
440 |
| - | |
| 394 | + | |
| 395 | + | |
441 | 396 |
| |
442 | 397 |
| |
443 | 398 |
| |
| |||
611 | 566 |
| |
612 | 567 |
| |
613 | 568 |
| |
614 |
| - | |
615 |
| - | |
616 |
| - | |
617 |
| - | |
618 |
| - | |
619 |
| - | |
620 |
| - | |
621 |
| - | |
622 |
| - | |
| 569 | + | |
623 | 570 |
| |
624 |
| - | |
625 |
| - | |
626 |
| - | |
627 |
| - | |
628 |
| - | |
629 |
| - | |
630 |
| - | |
| 571 | + | |
631 | 572 |
| |
632 | 573 |
| |
633 | 574 |
| |
| |||
991 | 932 |
| |
992 | 933 |
| |
993 | 934 |
| |
994 |
| - | |
995 |
| - | |
996 |
| - | |
997 |
| - | |
998 |
| - | |
999 |
| - | |
1000 |
| - | |
1001 |
| - | |
1002 |
| - | |
1003 |
| - | |
1004 |
| - | |
1005 |
| - | |
1006 |
| - | |
1007 |
| - | |
1008 |
| - | |
1009 |
| - | |
1010 |
| - | |
| 935 | + | |
1011 | 936 |
| |
1012 | 937 |
| |
1013 | 938 |
| |
| |||
1020 | 945 |
| |
1021 | 946 |
| |
1022 | 947 |
| |
1023 |
| - | |
| 948 | + | |
1024 | 949 |
| |
1025 | 950 |
| |
1026 | 951 |
| |
1027 | 952 |
| |
1028 | 953 |
| |
1029 |
| - | |
1030 |
| - | |
1031 |
| - | |
1032 |
| - | |
1033 |
| - | |
1034 |
| - | |
1035 |
| - | |
1036 |
| - | |
1037 |
| - | |
1038 |
| - | |
1039 |
| - | |
1040 |
| - | |
1041 |
| - | |
1042 |
| - | |
1043 |
| - | |
1044 | 954 |
| |
1045 | 955 |
| |
1046 | 956 |
| |
| |||
1103 | 1013 |
| |
1104 | 1014 |
| |
1105 | 1015 |
| |
1106 |
| - | |
| 1016 | + | |
1107 | 1017 |
| |
1108 | 1018 |
| |
1109 | 1019 |
| |
1110 | 1020 |
| |
1111 | 1021 |
| |
1112 |
| - | |
1113 |
| - | |
1114 |
| - | |
1115 |
| - | |
1116 |
| - | |
1117 |
| - | |
1118 |
| - | |
1119 |
| - | |
1120 |
| - | |
1121 |
| - | |
1122 |
| - | |
1123 |
| - | |
1124 |
| - | |
1125 |
| - | |
1126 |
| - | |
1127 | 1022 |
| |
1128 | 1023 |
| |
1129 | 1024 |
| |
|
0 commit comments
Comments
(0)