forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite29c464
committed
Refactor ListenSocket array.
Keep track of the used size of the array. That avoids looping throughthe whole array in a few places. It doesn't matter from a performancepoint of view since the array is small anyway, but this feels lesssurprising and is a little less code. Now that we have an explicitNumListenSockets variable that is statically initialized to 0, wedon't need the loop to initialize the array.Allocate the array in PostmasterContext. The array isn't needed inchild processes, so this allows reusing that memory. We could easilymake the array resizable now, but we haven't heard any complaintsabout the current 64 sockets limit.Discussion:https://www.postgresql.org/message-id/7bb7ad65-a018-2419-742f-fa5fd877d338@iki.fi1 parent1c99cde commite29c464
File tree
3 files changed
+40
-61
lines changed- src
- backend
- libpq
- postmaster
- include/libpq
3 files changed
+40
-61
lines changedLines changed: 8 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
311 | 311 |
| |
312 | 312 |
| |
313 | 313 |
| |
314 |
| - | |
315 |
| - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
316 | 318 |
| |
317 | 319 |
| |
318 | 320 |
| |
319 |
| - | |
320 | 321 |
| |
321 | 322 |
| |
322 | 323 |
| |
323 |
| - | |
| 324 | + | |
324 | 325 |
| |
325 | 326 |
| |
326 | 327 |
| |
| |||
335 | 336 |
| |
336 | 337 |
| |
337 | 338 |
| |
338 |
| - | |
339 | 339 |
| |
340 | 340 |
| |
341 | 341 |
| |
| |||
401 | 401 |
| |
402 | 402 |
| |
403 | 403 |
| |
404 |
| - | |
405 |
| - | |
406 |
| - | |
407 |
| - | |
408 |
| - | |
409 |
| - | |
| 404 | + | |
410 | 405 |
| |
411 | 406 |
| |
412 | 407 |
| |
| |||
573 | 568 |
| |
574 | 569 |
| |
575 | 570 |
| |
576 |
| - | |
| 571 | + | |
| 572 | + | |
577 | 573 |
| |
578 | 574 |
| |
579 | 575 |
| |
|
Lines changed: 31 additions & 48 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
227 | 227 |
| |
228 | 228 |
| |
229 | 229 |
| |
230 |
| - | |
| 230 | + | |
| 231 | + | |
231 | 232 |
| |
232 | 233 |
| |
233 | 234 |
| |
| |||
588 | 589 |
| |
589 | 590 |
| |
590 | 591 |
| |
591 |
| - | |
592 | 592 |
| |
593 | 593 |
| |
594 | 594 |
| |
| |||
1142 | 1142 |
| |
1143 | 1143 |
| |
1144 | 1144 |
| |
1145 |
| - | |
1146 |
| - | |
1147 |
| - | |
1148 |
| - | |
1149 |
| - | |
1150 |
| - | |
1151 |
| - | |
1152 |
| - | |
1153 |
| - | |
1154 |
| - | |
1155 |
| - | |
1156 | 1145 |
| |
1157 | 1146 |
| |
1158 | 1147 |
| |
| |||
1187 | 1176 |
| |
1188 | 1177 |
| |
1189 | 1178 |
| |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
1190 | 1182 |
| |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
1191 | 1186 |
| |
1192 | 1187 |
| |
1193 | 1188 |
| |
| |||
1216 | 1211 |
| |
1217 | 1212 |
| |
1218 | 1213 |
| |
1219 |
| - | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
1220 | 1217 |
| |
1221 | 1218 |
| |
1222 | 1219 |
| |
1223 | 1220 |
| |
1224 |
| - | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
1225 | 1224 |
| |
1226 | 1225 |
| |
1227 | 1226 |
| |
| |||
1249 | 1248 |
| |
1250 | 1249 |
| |
1251 | 1250 |
| |
1252 |
| - | |
| 1251 | + | |
1253 | 1252 |
| |
1254 | 1253 |
| |
1255 | 1254 |
| |
| |||
1313 | 1312 |
| |
1314 | 1313 |
| |
1315 | 1314 |
| |
1316 |
| - | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
1317 | 1318 |
| |
1318 | 1319 |
| |
1319 | 1320 |
| |
| |||
1339 | 1340 |
| |
1340 | 1341 |
| |
1341 | 1342 |
| |
1342 |
| - | |
| 1343 | + | |
1343 | 1344 |
| |
1344 | 1345 |
| |
1345 | 1346 |
| |
| |||
1487 | 1488 |
| |
1488 | 1489 |
| |
1489 | 1490 |
| |
1490 |
| - | |
1491 |
| - | |
1492 |
| - | |
1493 |
| - | |
1494 |
| - | |
1495 |
| - | |
1496 |
| - | |
1497 |
| - | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
1498 | 1494 |
| |
1499 | 1495 |
| |
1500 | 1496 |
| |
| |||
1695 | 1691 |
| |
1696 | 1692 |
| |
1697 | 1693 |
| |
1698 |
| - | |
1699 |
| - | |
1700 | 1694 |
| |
1701 | 1695 |
| |
1702 | 1696 |
| |
1703 | 1697 |
| |
1704 |
| - | |
1705 |
| - | |
1706 |
| - | |
1707 |
| - | |
1708 |
| - | |
1709 |
| - | |
1710 |
| - | |
1711 |
| - | |
1712 |
| - | |
1713 |
| - | |
| 1698 | + | |
| 1699 | + | |
1714 | 1700 |
| |
1715 | 1701 |
| |
1716 | 1702 |
| |
1717 | 1703 |
| |
1718 | 1704 |
| |
1719 |
| - | |
1720 |
| - | |
| 1705 | + | |
| 1706 | + | |
1721 | 1707 |
| |
1722 | 1708 |
| |
1723 | 1709 |
| |
| |||
2579 | 2565 |
| |
2580 | 2566 |
| |
2581 | 2567 |
| |
2582 |
| - | |
2583 |
| - | |
2584 |
| - | |
2585 |
| - | |
2586 |
| - | |
2587 |
| - | |
2588 |
| - | |
2589 |
| - | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
2590 | 2573 |
| |
2591 | 2574 |
| |
2592 | 2575 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
66 | 66 |
| |
67 | 67 |
| |
68 | 68 |
| |
69 |
| - | |
| 69 | + | |
70 | 70 |
| |
71 | 71 |
| |
72 | 72 |
| |
|
0 commit comments
Comments
(0)