Re: Avoid memory leaks during base backups

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Avoid memory leaks during base backups
Дата
Msg-id CA+TgmoY-b78iBQqLS56aRE-CQyjrFBuV+hT43WcuiuH8Jj_yYQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Avoid memory leaks during base backups  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Ответы Re: Avoid memory leaks during base backups  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Список pgsql-hackers
On Fri, Oct 21, 2022 at 2:18 AM Michael Paquier <michael@paquier.xyz> wrote:
> AFAIK, one of the callbacks associated to a memory context could
> fail, see comments before MemoryContextCallResetCallbacks() in
> MemoryContextDelete().  I agree that it should not matter here, but I
> think that it is better to reset the pointers before attempting the
> deletion of the memory context in this case.

I think this is nitpicking. There's no real danger here, and if there
were, the error handling would have to take it into account somehow,
which it doesn't.

I'd probably do it before resetting the context as a matter of style,
to make it clear that there's no window in which the pointers are set
but referencing invalid memory. But I do not think it makes any
practical difference at all.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



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

Предыдущее
От: Japin Li
Дата:
Сообщение: Re: parse partition strategy string in gram.y
Следующее
От: Marina Polyakova
Дата:
Сообщение: Re: ICU for global collation