From b0025bd95703aaedc4ff23ddcfbde9597fa0919d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 11 Sep 2011 16:29:42 -0400 Subject: Invent a new memory context primitive, MemoryContextSetParent. This function will be useful for altering the lifespan of a context after creation (for example, by creating it under a transient context and later reparenting it to belong to a long-lived context). It costs almost no new code, since we can refactor what was there. Per my proposal of yesterday. --- src/include/utils/memutils.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/include/utils/memutils.h') diff --git a/src/include/utils/memutils.h b/src/include/utils/memutils.h index 7c1202478e5..94c78289b6e 100644 --- a/src/include/utils/memutils.h +++ b/src/include/utils/memutils.h @@ -90,6 +90,8 @@ extern void MemoryContextDelete(MemoryContext context); extern void MemoryContextResetChildren(MemoryContext context); extern void MemoryContextDeleteChildren(MemoryContext context); extern void MemoryContextResetAndDeleteChildren(MemoryContext context); +extern void MemoryContextSetParent(MemoryContext context, + MemoryContext new_parent); extern Size GetMemoryChunkSpace(void *pointer); extern MemoryContext GetMemoryChunkContext(void *pointer); extern bool MemoryContextIsEmpty(MemoryContext context); -- cgit v1.2.3