Re: Safe memory allocation functions - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Safe memory allocation functions
Date
Msg-id 20150116140851.GC21581@alap3.anarazel.de
Whole thread Raw
In response to Re: Safe memory allocation functions  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On 2015-01-16 08:47:10 +0900, Michael Paquier wrote:
> On Fri, Jan 16, 2015 at 12:57 AM, Alvaro Herrera
> <alvherre@2ndquadrant.com> wrote:
> >> 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.
> Voting for palloc_noerror() as well.

I don't like that name. It very well can error out. E.g. because of the
allocation size. And we definitely do not want to ignore that case. How
about palloc_try()?

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Safe memory allocation functions
Next
From: Andres Freund
Date:
Subject: Re: Safe memory allocation functions