forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5ee190f
committed
Rationalize use of list_concat + list_copy combinations.
In the wake of commit1cff1b9, the result of list_concat no longershares the ListCells of the second input. Therefore, we can replace"list_concat(x, list_copy(y))" with just "list_concat(x, y)".To improve call sites that were list_copy'ing the first argument,or both arguments, invent "list_concat_copy()" which produces a newlist sharing no ListCells with either input. (This is a bit fasterthan "list_concat(list_copy(x), y)" because it makes the result listthe right size to start with.)In call sites that were not list_copy'ing the second argument, the newsemantics mean that we are usually leaking the second List's storage,since typically there is no remaining pointer to it. We consideredinventing another list_copy variant that would list_free the secondinput, but concluded that for most call sites it isn't worth worryingabout, given the relative compactness of the new List representation.(Note that in cases where such leakage would happen, the old codealready leaked the second List's header; so we're only discussingthe size of the leak not whether there is one. I did adjust two orthree places that had been troubling to free that header so thatthey manually free the whole second List.)Patch by me; thanks to David Rowley for review.Discussion:https://postgr.es/m/11587.1550975080@sss.pgh.pa.us1 parent251c8e3 commit5ee190f
File tree
26 files changed
+130
-148
lines changed- contrib/postgres_fdw
- src
- backend
- commands
- executor
- nodes
- optimizer
- path
- plan
- prep
- util
- parser
- partitioning
- replication
- rewrite
- utils/adt
- include/nodes
26 files changed
+130
-148
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1497 | 1497 |
| |
1498 | 1498 |
| |
1499 | 1499 |
| |
1500 |
| - | |
| 1500 | + | |
1501 | 1501 |
| |
1502 | 1502 |
| |
1503 | 1503 |
| |
|
Lines changed: 7 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2667 | 2667 |
| |
2668 | 2668 |
| |
2669 | 2669 |
| |
2670 |
| - | |
| 2670 | + | |
2671 | 2671 |
| |
2672 | 2672 |
| |
2673 | 2673 |
| |
| |||
5102 | 5102 |
| |
5103 | 5103 |
| |
5104 | 5104 |
| |
5105 |
| - | |
| 5105 | + | |
5106 | 5106 |
| |
5107 |
| - | |
| 5107 | + | |
5108 | 5108 |
| |
5109 | 5109 |
| |
5110 | 5110 |
| |
5111 | 5111 |
| |
5112 |
| - | |
| 5112 | + | |
5113 | 5113 |
| |
5114 |
| - | |
| 5114 | + | |
5115 | 5115 |
| |
5116 | 5116 |
| |
5117 | 5117 |
| |
5118 | 5118 |
| |
5119 |
| - | |
| 5119 | + | |
5120 | 5120 |
| |
5121 |
| - | |
| 5121 | + | |
5122 | 5122 |
| |
5123 | 5123 |
| |
5124 | 5124 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
516 | 516 |
| |
517 | 517 |
| |
518 | 518 |
| |
519 |
| - | |
520 |
| - | |
| 519 | + | |
| 520 | + | |
521 | 521 |
| |
522 | 522 |
| |
523 | 523 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
719 | 719 |
| |
720 | 720 |
| |
721 | 721 |
| |
722 |
| - | |
723 |
| - | |
| 722 | + | |
724 | 723 |
| |
725 | 724 |
| |
726 | 725 |
| |
|
Lines changed: 44 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
501 | 501 |
| |
502 | 502 |
| |
503 | 503 |
| |
504 |
| - | |
505 |
| - | |
506 |
| - | |
507 |
| - | |
508 |
| - | |
509 |
| - | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
510 | 513 |
| |
511 | 514 |
| |
512 | 515 |
| |
| |||
534 | 537 |
| |
535 | 538 |
| |
536 | 539 |
| |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
537 | 575 |
| |
538 | 576 |
| |
539 | 577 |
| |
|
Lines changed: 5 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1266 | 1266 |
| |
1267 | 1267 |
| |
1268 | 1268 |
| |
1269 |
| - | |
| 1269 | + | |
1270 | 1270 |
| |
1271 | 1271 |
| |
1272 | 1272 |
| |
| |||
1347 | 1347 |
| |
1348 | 1348 |
| |
1349 | 1349 |
| |
1350 |
| - | |
1351 |
| - | |
1352 |
| - | |
| 1350 | + | |
| 1351 | + | |
1353 | 1352 |
| |
1354 | 1353 |
| |
1355 | 1354 |
| |
| |||
2048 | 2047 |
| |
2049 | 2048 |
| |
2050 | 2049 |
| |
2051 |
| - | |
2052 |
| - | |
| 2050 | + | |
2053 | 2051 |
| |
2054 | 2052 |
| |
2055 | 2053 |
| |
| |||
2072 | 2070 |
| |
2073 | 2071 |
| |
2074 | 2072 |
| |
2075 |
| - | |
2076 |
| - | |
| 2073 | + | |
2077 | 2074 |
| |
2078 | 2075 |
| |
2079 | 2076 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4443 | 4443 |
| |
4444 | 4444 |
| |
4445 | 4445 |
| |
4446 |
| - | |
4447 |
| - | |
| 4446 | + | |
4448 | 4447 |
| |
4449 | 4448 |
| |
4450 | 4449 |
| |
|
Lines changed: 7 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
656 | 656 |
| |
657 | 657 |
| |
658 | 658 |
| |
659 |
| - | |
| 659 | + | |
660 | 660 |
| |
661 | 661 |
| |
662 | 662 |
| |
| |||
1204 | 1204 |
| |
1205 | 1205 |
| |
1206 | 1206 |
| |
1207 |
| - | |
1208 |
| - | |
| 1207 | + | |
1209 | 1208 |
| |
1210 | 1209 |
| |
1211 | 1210 |
| |
| |||
1270 | 1269 |
| |
1271 | 1270 |
| |
1272 | 1271 |
| |
1273 |
| - | |
| 1272 | + | |
1274 | 1273 |
| |
1275 | 1274 |
| |
1276 | 1275 |
| |
| |||
1506 | 1505 |
| |
1507 | 1506 |
| |
1508 | 1507 |
| |
1509 |
| - | |
1510 |
| - | |
| 1508 | + | |
1511 | 1509 |
| |
1512 | 1510 |
| |
1513 | 1511 |
| |
| |||
1543 | 1541 |
| |
1544 | 1542 |
| |
1545 | 1543 |
| |
1546 |
| - | |
1547 |
| - | |
1548 |
| - | |
1549 |
| - | |
| 1544 | + | |
| 1545 | + | |
1550 | 1546 |
| |
1551 | 1547 |
| |
1552 | 1548 |
| |
| |||
1849 | 1845 |
| |
1850 | 1846 |
| |
1851 | 1847 |
| |
1852 |
| - | |
| 1848 | + | |
1853 | 1849 |
| |
1854 | 1850 |
| |
1855 | 1851 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
559 | 559 |
| |
560 | 560 |
| |
561 | 561 |
| |
562 |
| - | |
563 |
| - | |
| 562 | + | |
| 563 | + | |
564 | 564 |
| |
565 | 565 |
| |
566 | 566 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
973 | 973 |
| |
974 | 974 |
| |
975 | 975 |
| |
976 |
| - | |
977 | 976 |
| |
978 | 977 |
| |
979 | 978 |
| |
|
Lines changed: 4 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3572 | 3572 |
| |
3573 | 3573 |
| |
3574 | 3574 |
| |
3575 |
| - | |
3576 |
| - | |
3577 |
| - | |
3578 |
| - | |
3579 | 3575 |
| |
3580 | 3576 |
| |
3581 | 3577 |
| |
| |||
4287 | 4283 |
| |
4288 | 4284 |
| |
4289 | 4285 |
| |
4290 |
| - | |
4291 |
| - | |
| 4286 | + | |
| 4287 | + | |
4292 | 4288 |
| |
4293 | 4289 |
| |
4294 | 4290 |
| |
| |||
4473 | 4469 |
| |
4474 | 4470 |
| |
4475 | 4471 |
| |
4476 |
| - | |
| 4472 | + | |
4477 | 4473 |
| |
4478 | 4474 |
| |
4479 | 4475 |
| |
| |||
5642 | 5638 |
| |
5643 | 5639 |
| |
5644 | 5640 |
| |
5645 |
| - | |
5646 |
| - | |
| 5641 | + | |
5647 | 5642 |
| |
5648 | 5643 |
| |
5649 | 5644 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
893 | 893 |
| |
894 | 894 |
| |
895 | 895 |
| |
896 |
| - | |
| 896 | + | |
897 | 897 |
| |
898 | 898 |
| |
899 | 899 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2659 | 2659 |
| |
2660 | 2660 |
| |
2661 | 2661 |
| |
2662 |
| - | |
2663 | 2662 |
| |
2664 | 2663 |
| |
2665 | 2664 |
| |
|
Lines changed: 0 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
328 | 328 |
| |
329 | 329 |
| |
330 | 330 |
| |
331 |
| - | |
332 |
| - | |
333 |
| - | |
334 |
| - | |
335 |
| - | |
336 |
| - | |
337 | 331 |
| |
338 | 332 |
| |
339 | 333 |
| |
| |||
360 | 354 |
| |
361 | 355 |
| |
362 | 356 |
| |
363 |
| - | |
364 |
| - | |
365 |
| - | |
366 |
| - | |
367 |
| - | |
368 |
| - | |
369 | 357 |
| |
370 | 358 |
| |
371 | 359 |
| |
|
0 commit comments
Comments
(0)