Re: Change pfree to accept NULL argument

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Change pfree to accept NULL argument
Дата
Msg-id 377390.1661193022@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Change pfree to accept NULL argument  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Ответы Re: Change pfree to accept NULL argument  (Andres Freund <andres@anarazel.de>)
Re: Change pfree to accept NULL argument  (David Rowley <dgrowleyml@gmail.com>)
Re: Change pfree to accept NULL argument  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список pgsql-hackers
Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
> Per discussion in [0], here is a patch set that allows pfree() to accept 
> a NULL argument, like free() does.

So the question is, is this actually a good thing to do?

If we were starting in a green field, I'd be fine with defining
pfree(NULL) as okay.  But we're not, so there are a couple of big
objections:

* Code developed to this standard will be unsafe to back-patch

* The sheer number of places touched will create back-patching
hazards.

I'm not very convinced that the benefits of making pfree() more
like free() are worth those costs.

We could ameliorate the first objection if we wanted to back-patch
0002, I guess.

(FWIW, no objection to your 0001.  0004 and 0005 seem okay too;
they don't touch enough places to create much back-patching risk.)

            regards, tom lane



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Change pfree to accept NULL argument
Следующее
От: Robert Haas
Дата:
Сообщение: standby promotion can create unreadable WAL