Re: Missing checks when malloc returns NULL...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Missing checks when malloc returns NULL...
Дата
Msg-id 26290.1472564565@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Missing checks when malloc returns NULL...  (Aleksander Alekseev <a.alekseev@postgrespro.ru>)
Список pgsql-hackers
Aleksander Alekseev <a.alekseev@postgrespro.ru> writes:
> I suggest to keep ShmemAlloc as is for backward compatibility and
> introduce a new procedure ShmemAllocSafe.

I think that's about the worst of all possible worlds, as it guarantees
having to touch most call sites.  If there were more than one known caller
that really wanted the return-NULL behavior, exact backwards compatibility
might carry the day; but as things stand I think the odds are that most
call sites need an error check and probably have not got one.  I'd rather
err in favor of "safe by default" than "backwards compatible".
        regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Missing checks when malloc returns NULL...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: standalone backend PANICs during recovery