forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6755558
committed
Improve aset.c's space management in contexts with small maxBlockSize.
The previous coding would allow requests up to half of maxBlockSize to betreated as "chunks", but when that actually did happen, we'd waste nearlyhalf of the space in the malloc block containing the chunk, if no smallerrequests came along to fill it. Avoid this scenario by limiting themaximum size of a chunk to 1/8th maxBlockSize, so that we can waste no morethan 1/8th of the allocated space. This will not change the behavior atall for the default context size parameters (with large maxBlockSize),but it will change the behavior when using ALLOCSET_SMALL_MAXSIZE.In particular, there's no longer a need for spell.c to be overly concernedabout the request size parameters it uses, so remove a rather unhelpfulcomment about that.Merlin Moncure, per an idea of Tom Lane's1 parent5c436a7 commit6755558
2 files changed
+18
-9
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
75 | 75 |
| |
76 | 76 |
| |
77 | 77 |
| |
78 |
| - | |
| 78 | + | |
79 | 79 |
| |
80 | 80 |
| |
81 | 81 |
| |
|
Lines changed: 17 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
89 | 89 |
| |
90 | 90 |
| |
91 | 91 |
| |
92 |
| - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
93 | 95 |
| |
94 | 96 |
| |
95 | 97 |
| |
96 | 98 |
| |
97 | 99 |
| |
98 | 100 |
| |
99 | 101 |
| |
| 102 | + | |
| 103 | + | |
100 | 104 |
| |
101 | 105 |
| |
102 | 106 |
| |
| |||
380 | 384 |
| |
381 | 385 |
| |
382 | 386 |
| |
383 |
| - | |
384 |
| - | |
385 |
| - | |
386 |
| - | |
387 |
| - | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
388 | 397 |
| |
389 | 398 |
| |
390 |
| - | |
391 |
| - | |
| 399 | + | |
| 400 | + | |
392 | 401 |
| |
393 | 402 |
| |
394 | 403 |
| |
|
0 commit comments
Comments
(0)