forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commiteaa5808
committed
Redefine MemoryContextReset() as deleting, not resetting, child contexts.
That is, MemoryContextReset() now means what was formerly meant byMemoryContextResetAndDeleteChildren(), and the latter is now just a macroalias for the former. If you really want the functionality that wasformerly provided by MemoryContextReset(), what you have to do isMemoryContextResetChildren() plus MemoryContextResetOnly() (which is anew API to reset *only* the named context and not touch its children).The reason for this change is that near fifteen years of experience hasproven that there is noplace where old-style MemoryContextReset() isactually what you want. Making that the default behavior has led to lotsof context-leakage bugs, while we've not found anyplace where it's actuallynecessary to keep the child contexts; at least the standard regressiontests do not reveal anyplace where this change breaks anything. And thereare upcoming patches that will introduce additional reasons why childcontexts need to be removed.We could change existing calls of MemoryContextResetAndDeleteChildren to bejust MemoryContextReset, but for the moment I'll leave them alone; they'renot costing anything.1 parentfbef434 commiteaa5808
3 files changed
+34
-28
lines changedLines changed: 8 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
125 | 125 |
| |
126 | 126 |
| |
127 | 127 |
| |
128 |
| - | |
129 |
| - | |
130 |
| - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
131 | 136 |
| |
132 | 137 |
| |
133 | 138 |
| |
|
Lines changed: 22 additions & 24 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
132 | 132 |
| |
133 | 133 |
| |
134 | 134 |
| |
135 |
| - | |
136 |
| - | |
137 |
| - | |
138 |
| - | |
139 |
| - | |
| 135 | + | |
| 136 | + | |
140 | 137 |
| |
141 | 138 |
| |
142 | 139 |
| |
| |||
145 | 142 |
| |
146 | 143 |
| |
147 | 144 |
| |
148 |
| - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
149 | 161 |
| |
150 | 162 |
| |
151 | 163 |
| |
| |||
172 | 184 |
| |
173 | 185 |
| |
174 | 186 |
| |
175 |
| - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
176 | 191 |
| |
177 | 192 |
| |
178 | 193 |
| |
| |||
234 | 249 |
| |
235 | 250 |
| |
236 | 251 |
| |
237 |
| - | |
238 |
| - | |
239 |
| - | |
240 |
| - | |
241 |
| - | |
242 |
| - | |
243 |
| - | |
244 |
| - | |
245 |
| - | |
246 |
| - | |
247 |
| - | |
248 |
| - | |
249 |
| - | |
250 |
| - | |
251 |
| - | |
252 |
| - | |
253 |
| - | |
254 | 252 |
| |
255 | 253 |
| |
256 | 254 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
84 | 84 |
| |
85 | 85 |
| |
86 | 86 |
| |
| 87 | + | |
| 88 | + | |
| 89 | + | |
87 | 90 |
| |
88 | 91 |
| |
89 | 92 |
| |
90 | 93 |
| |
91 | 94 |
| |
92 | 95 |
| |
93 | 96 |
| |
| 97 | + | |
94 | 98 |
| |
95 | 99 |
| |
96 |
| - | |
97 | 100 |
| |
98 | 101 |
| |
99 | 102 |
| |
|
0 commit comments
Comments
(0)