Re: Safe memory allocation functions

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Safe memory allocation functions
Дата
Msg-id 20150115155705.GP1663@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Safe memory allocation functions  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Safe memory allocation functions  (Michael Paquier <michael.paquier@gmail.com>)
Re: Safe memory allocation functions  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas wrote:

> Hmm, I understood Tom to be opposing the idea of a palloc variant that
> returns NULL on failure, and I understand you to be supporting it.
> But maybe I'm confused.

Your understanding seems correct to me.  I was just saying that your
description of Tom's argument to dislike the idea seemed at odds with
what he was actually saying.

> Anyway, I support it.  I agree that there are
> systems (or circumstances?) where malloc is going to succeed and then
> the world will blow up later on anyway, but I don't think that means
> that an out-of-memory error is the only sensible response to a palloc
> failure; returning NULL seems like a sometimes-useful alternative.
> 
> I do think that "safe" is the wrong suffix.  Maybe palloc_soft_fail()
> or palloc_null() or palloc_no_oom() or palloc_unsafe().

I liked palloc_noerror() better myself FWIW.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: TODO : Allow parallel cores to be used by vacuumdb [ WIP ]
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: EvalPlanQual behaves oddly for FDW queries involving system columns