mirror of
https://github.com/postgres/postgres.git
synced 2025-11-28 11:44:57 +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:
@@ -60,6 +60,9 @@ typedef struct MemoryContextData
|
||||
MemoryContext nextchild; /* next child of same parent */
|
||||
char *name; /* context name (just for debugging) */
|
||||
bool isReset; /* T = no space alloced since last reset */
|
||||
#ifdef USE_ASSERT_CHECKING
|
||||
bool allowInCritSection; /* allow palloc in critical section */
|
||||
#endif
|
||||
} MemoryContextData;
|
||||
|
||||
/* utils/palloc.h contains typedef struct MemoryContextData *MemoryContext */
|
||||
|
||||
Reference in New Issue
Block a user