mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
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.
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user