Re: Rethinking MemoryContext creation
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>,
pgsql-hackers@lists.postgresql.org
Date: 2017-12-11T17:42:51Z
Lists: 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
Commits
-
Rethink MemoryContext creation to improve performance.
- 9fa6f00b1308 11.0 landed