Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset
От | Tom Lane |
---|---|
Тема | Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset |
Дата | |
Msg-id | 29694.1424989019@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset (Alvaro Herrera <alvherre@2ndquadrant.com>) |
Список | pgsql-hackers |
Alvaro Herrera <alvherre@2ndquadrant.com> writes: > Tom Lane wrote: >> Thoughts? Any objections to pushing this? > Is there any reason at all to keep > MemoryContextResetButPreserveChildren()? Since your patch doesn't add > any callers, it seems pretty likely that there's none anywhere. The only reason to keep it is to have an "out" if it turns out that some third-party code actually needs that behavior. On reflection, maybe a better API to offer for that eventuality is a function named something like MemoryContextResetOnly(), which would leave child contexts completely alone. Then, if you want the old functionality, you could get it with MemoryContextResetOnly plus MemoryContextResetChildren. BTW, the original thread discussed the idea of moving context bookkeeping blocks into the immediate parent context, but the usefulness of MemoryContextSetParent() negates the thought that that would be a good plan. So there's no real issue here other than potential backwards compatibility for external code. regards, tom lane
В списке pgsql-hackers по дате отправления: