pgsql: Simplify use of AllocSetContextCreate() wrapper macro.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Simplify use of AllocSetContextCreate() wrapper macro.
Date: 2018-10-12 18:27:17
Message-ID: E1gB29d-0005k6-JX@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Simplify use of AllocSetContextCreate() wrapper macro.

We can allow this macro to accept either abbreviated or non-abbreviated
allocation parameters by making use of __VA_ARGS__. As noted by Andres
Freund, it's unlikely that any compiler would have __builtin_constant_p
but not __VA_ARGS__, so this gives up little or no error checking, and
it avoids a minor but annoying API break for extensions.

With this change, there is no reason for anybody to call
AllocSetContextCreateExtended directly, so in HEAD I renamed it to
AllocSetContextCreateInternal. It's probably too late for an ABI
break like that in 11, though.

Discussion: https://postgr.es/m/20181012170355.bhxi273skjt6sag4@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/13cd7209f794d9dff8084c9748a78a0a5bf0464a

Modified Files
--------------
src/backend/access/transam/xact.c | 10 +++++-----
src/backend/utils/mmgr/aset.c | 10 ++++++----
src/backend/utils/mmgr/mcxt.c | 10 +++++-----
src/include/utils/memutils.h | 13 ++++++-------
4 files changed, 22 insertions(+), 21 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-10-12 18:49:48 pgsql: Back-patch addition of the ALLOCSET_FOO_SIZES macros.
Previous Message Tom Lane 2018-10-12 15:42:39 pgsql: Remove dead reference to ecpg resultmap file.