summaryrefslogtreecommitdiff
path: root/src/include/utils/memutils.h
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-06-30 10:13:48 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-06-30 10:26:00 +0300
commit1c6821be31f91ab92547a8ed4246762c8cefb1b3 (patch)
treede5e845c96e8f37b7073708a5bdf9e6b81c6abc9 /src/include/utils/memutils.h
parenta749a23d7af4dba9b3468076ec561d2cbf69af09 (diff)
downloadpostgresql-1c6821be31f91ab92547a8ed4246762c8cefb1b3.tar.gz
Fix and enhance the assertion of no palloc's in a critical section.
The assertion failed if WAL_DEBUG or LWLOCK_STATS was enabled; fix that by using separate memory contexts for the allocations made within those code blocks. This patch introduces a mechanism for marking any memory context as allowed in a critical section. Previously ErrorContext was exempt as a special case. Instead of a blanket exception of the checkpointer process, only exempt the memory context used for the pending ops hash table.
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 59d0aecfbb..2fede86027 100644
--- a/src/include/utils/memutils.h
+++ b/src/include/utils/memutils.h
@@ -101,6 +101,8 @@ extern MemoryContext GetMemoryChunkContext(void *pointer);
extern MemoryContext MemoryContextGetParent(MemoryContext context);
extern bool MemoryContextIsEmpty(MemoryContext context);
extern void MemoryContextStats(MemoryContext context);
+extern void MemoryContextAllowInCriticalSection(MemoryContext context,
+ bool allow);
#ifdef MEMORY_CONTEXT_CHECKING
extern void MemoryContextCheck(MemoryContext context);