diff options
Diffstat (limited to 'src/backend/utils/mmgr')
-rw-r--r-- | src/backend/utils/mmgr/mcxt.c | 12 | ||||
-rw-r--r-- | src/backend/utils/mmgr/portalmem.c | 6 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c index 4eab24c46c7..466e9334cfb 100644 --- a/src/backend/utils/mmgr/mcxt.c +++ b/src/backend/utils/mmgr/mcxt.c @@ -343,6 +343,18 @@ GetMemoryChunkContext(void *pointer) } /* + * MemoryContextGetParent + * Get the parent context (if any) of the specified context + */ +MemoryContext +MemoryContextGetParent(MemoryContext context) +{ + AssertArg(MemoryContextIsValid(context)); + + return context->parent; +} + +/* * MemoryContextIsEmpty * Is a memory context empty of any allocated space? */ diff --git a/src/backend/utils/mmgr/portalmem.c b/src/backend/utils/mmgr/portalmem.c index 609758ecd23..7fbf1a5efad 100644 --- a/src/backend/utils/mmgr/portalmem.c +++ b/src/backend/utils/mmgr/portalmem.c @@ -280,9 +280,9 @@ CreateNewPortal(void) * (before rewriting) was an empty string. Also, the passed commandTag must * be a pointer to a constant string, since it is not copied. * - * If cplan is provided, then it is a cached plan containing the stmts, - * and the caller must have done RevalidateCachedPlan(), causing a refcount - * increment. The refcount will be released when the portal is destroyed. + * If cplan is provided, then it is a cached plan containing the stmts, and + * the caller must have done GetCachedPlan(), causing a refcount increment. + * The refcount will be released when the portal is destroyed. * * If cplan is NULL, then it is the caller's responsibility to ensure that * the passed plan trees have adequate lifetime. Typically this is done by |