Re: AllocSetContextCreate changes breake extensions
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org, Christoph Berg <cb@df7cb.de>
Date: 2018-10-12T17:51:53Z
Lists: pgsql-hackers
Andres Freund <andres@anarazel.de> writes: > But can't we just do something like: > #if defined(HAVE__BUILTIN_CONSTANT_P) && defined(HAVE__VA_ARGS) > #define AllocSetContextCreate(parent, name, ...) \ > (StaticAssertExpr(__builtin_constant_p(name), \ > "memory context names must be constant strings"), \ > AllocSetContextCreateExtended(parent, name, __VA_ARGS__)) > #else > #define AllocSetContextCreate \ > AllocSetContextCreateExtended > #endif > The set of compilers that have __builtin_constant_p and not vararg > macros got to be about empty. Yeah, fair point, and anyway we don't need the StaticAssert to exist everywhere. I'll make it so. Shall we also backpatch the ALLOCSET_*_SIZES macros as Christoph suggested? I'm not convinced of the usefulness of that, since extensions would still have to cope with them not being present when building against existing minor releases. regards, tom lane
Commits
-
Back-patch addition of the ALLOCSET_FOO_SIZES macros.
- ec185747a46e 9.4.20 landed
- 1245561df490 9.5.15 landed
- 01187f32cd61 9.3.25 landed
-
Simplify use of AllocSetContextCreate() wrapper macro.
- 3d059655be7d 11.0 landed
- 13cd7209f794 12.0 landed
-
Rethink MemoryContext creation to improve performance.
- 9fa6f00b1308 11.0 cited