aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/memutils.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-09-11 16:29:42 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-09-11 16:29:42 -0400
commitb0025bd95703aaedc4ff23ddcfbde9597fa0919d (patch)
tree23e4a900474f51b2c7932fffcf276e8141e0c389 /src/include/utils/memutils.h
parent5f42e5945b3dd96c228531c0730f418846ced04e (diff)
downloadpostgresql-b0025bd95703aaedc4ff23ddcfbde9597fa0919d.tar.gz
postgresql-b0025bd95703aaedc4ff23ddcfbde9597fa0919d.zip
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.
Diffstat (limited to 'src/include/utils/memutils.h')
-rw-r--r--src/include/utils/memutils.h2
1 files changed, 2 insertions, 0 deletions
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);