Simplify use of AllocSetContextCreate() wrapper macro.
authorTom Lane
Fri, 12 Oct 2018 18:26:56 +0000 (14:26 -0400)
committerTom Lane
Fri, 12 Oct 2018 18:26:56 +0000 (14:26 -0400)
commit3d059655be7dfcb7124c6b3ce0925448de89f669
tree5fb279bb5e4182fcb92af0aaea91f4dba329c6f2
parent355684ee3fa3001adf0de3873fddadd119773819
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[email protected]
src/backend/access/transam/xact.c
src/backend/utils/mmgr/aset.c
src/backend/utils/mmgr/mcxt.c
src/include/utils/memutils.h