From: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Safe memory allocation functions |
Date: | 2015-01-27 08:03:59 |
Message-ID: | CAB7nPqTPCwrRDuaHBYZC0740VCyqtqJ82PhhAeAan6yq9QaxFw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sat, Jan 17, 2015 at 11:06 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Fri, Jan 16, 2015 at 10:56 AM, Alvaro Herrera
> <alvherre(at)2ndquadrant(dot)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?).
Yes, I think that this name makes more sense (LockAcquire[Extended],
RangeVarGetRelid[Extended]), as well as minimizing shorter name for
the flags.
--
Michael
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2015-01-27 08:05:17 | Re: Using 128-bit integers for sum, avg and statistics aggregates |
Previous Message | Amit Langote | 2015-01-27 07:55:29 | Re: Partitioning: issues/ideas (Was: Re: On partitioning) |