Re: Safe memory allocation functions

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Safe memory allocation functions
Дата
Msg-id CA+Tgmob56c=ifUq6O0dBQymqUSuvjmOgPg6fPsaytFJU57uQCw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Safe memory allocation functions  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Safe memory allocation functions  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On Fri, Jan 16, 2015 at 10:56 AM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> So how about something like
>
> #define ALLOCFLAG_HUGE                  0x01
> #define ALLOCFLAG_NO_ERROR_ON_OOM       0x02
> void *
> MemoryContextAllocFlags(MemoryContext context, Size size, int flags);

That sounds good, although personally I'd rather have the name be
something like MemoryContextAllocExtended; we have precedent for using
"Extended" for this sort of thing elsewhere.  Also, I'd suggest trying
to keep the flag name short, e.g. ALLOC_HUGE and ALLOC_NO_OOM (or
ALLOC_SOFT_FAIL?).

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: moving from contrib to bin
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Error check always bypassed in tablefunc.c