Re: Rethinking MemoryContext creation - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Rethinking MemoryContext creation
Date
Msg-id CA+TgmoZx=248OF_KWp8zDHH+pZjOh3i5MW_r0qo3XF5U19oZjA@mail.gmail.com
Whole thread Raw
In response to Re: Rethinking MemoryContext creation  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Rethinking MemoryContext creation
List pgsql-hackers
On Mon, Dec 11, 2017 at 12:36 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> [ thinks... ]  If we wanted to go that way, one thing we could do to
> help extension authors (and ourselves) is to define the proposed
> AllocSetContextCreate macro to include
>
>         StaticAssertExpr(__builtin_constant_p(name))
>
> on compilers that have __builtin_constant_p.  Now, that only helps
> people using gcc and gcc-alikes, but that's a large fraction of
> developers I should think.  (I tested this and it does seem to
> correctly recognize string literals as constants.)

I like that idea.  I think that would provide good protection not only
for third-party developers but for core developers.

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


pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: [HACKERS] Custom compression methods
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] Custom compression methods