forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitac12ab0
committed
Avoid trying to release a List's initial allocation via repalloc().
Commit1cff1b9 included some code that supposed it could repalloc()a memory chunk to a smaller size without risk of the chunk moving.That was not a great idea, because it depended on undocumented behaviorof AllocSetRealloc, which commitc477f3e changed thereby breaking it.(Not to mention that this code ought to work with other memory contexttypes, which might not work the same...) So get rid of the repalloccalls, and instead just wipe the now-unused ListCell array and/or tellValgrind it's NOACCESS, as if we'd freed it.In cases where the initial list allocation had been quite large, thiscould represent an annoying waste of space. In principle we couldameliorate that by allocating the initial cell array separately whenit exceeds some threshold. But that would complicate new_list() whichis hot code, and the returns would materialize only in narrow cases.On balance I don't think it'd be worth it.Discussion:https://postgr.es/m/17059.1570208426@sss.pgh.pa.us1 parent36425ec commitac12ab0
1 file changed
+21
-17
lines changedLines changed: 21 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| 21 | + | |
21 | 22 |
| |
22 | 23 |
| |
23 | 24 |
| |
| |||
172 | 173 |
| |
173 | 174 |
| |
174 | 175 |
| |
175 |
| - | |
176 |
| - | |
177 | 176 |
| |
178 | 177 |
| |
179 | 178 |
| |
| |||
188 | 187 |
| |
189 | 188 |
| |
190 | 189 |
| |
191 |
| - | |
192 |
| - | |
193 |
| - | |
194 |
| - | |
195 |
| - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
196 | 194 |
| |
197 |
| - | |
198 |
| - | |
199 |
| - | |
200 |
| - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
201 | 202 |
| |
202 | 203 |
| |
203 | 204 |
| |
| |||
736 | 737 |
| |
737 | 738 |
| |
738 | 739 |
| |
739 |
| - | |
740 |
| - | |
| 740 | + | |
| 741 | + | |
741 | 742 |
| |
742 |
| - | |
743 |
| - | |
744 |
| - | |
745 |
| - | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
746 | 750 |
| |
747 | 751 |
| |
748 | 752 |
| |
|
0 commit comments
Comments
(0)