Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset
Дата
Msg-id 30788.1424991351@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> ... Without a compiler erroring out people won't
> notice that suddenly MemoryContextReset deletes much more; leading to
> possibly hard to find errors.

BTW, so far as *data* is concerned, the existing call deletes all data in
the child contexts already.  The only not-already-buggy operation you could
perform before that would no longer work is to allocate fresh data in one
of those child contexts, assuming you still had a pointer to such a
context.  I've not seen any coding pattern in which that's likely.  The
problem is exactly that whoever's resetting the parent context isn't aware
of child contexts having been attached to it.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset