PostgreSQL Source Code  git master
mcxt.c File Reference
#include "postgres.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h"
#include "storage/proc.h"
#include "storage/procarray.h"
#include "storage/procsignal.h"
#include "utils/fmgrprotos.h"
#include "utils/memdebug.h"
#include "utils/memutils.h"
Include dependency graph for mcxt.c:

Go to the source code of this file.

Macros

#define AssertNotInCriticalSection(context)   Assert(CritSectionCount == 0 || (context)->allowInCritSection)
 

Functions

static void MemoryContextCallResetCallbacks (MemoryContext context)
 
static void MemoryContextStatsInternal (MemoryContext context, int level, bool print, int max_children, MemoryContextCounters *totals, bool print_to_stderr)
 
static void MemoryContextStatsPrint (MemoryContext context, void *passthru, const char *stats_string, bool print_to_stderr)
 
void MemoryContextInit (void)
 
void MemoryContextReset (MemoryContext context)
 
void MemoryContextResetOnly (MemoryContext context)
 
void MemoryContextResetChildren (MemoryContext context)
 
void MemoryContextDelete (MemoryContext context)
 
void MemoryContextDeleteChildren (MemoryContext context)
 
void MemoryContextRegisterResetCallback (MemoryContext context, MemoryContextCallback *cb)
 
void MemoryContextSetIdentifier (MemoryContext context, const char *id)
 
void MemoryContextSetParent (MemoryContext context, MemoryContext new_parent)
 
void MemoryContextAllowInCriticalSection (MemoryContext context, bool allow)
 
Size GetMemoryChunkSpace (void *pointer)
 
MemoryContext MemoryContextGetParent (MemoryContext context)
 
bool MemoryContextIsEmpty (MemoryContext context)
 
Size MemoryContextMemAllocated (MemoryContext context, bool recurse)
 
void MemoryContextStats (MemoryContext context)
 
void MemoryContextStatsDetail (MemoryContext context, int max_children, bool print_to_stderr)
 
bool MemoryContextContains (MemoryContext context, void *pointer)
 
void MemoryContextCreate (MemoryContext node, NodeTag tag, const MemoryContextMethods *methods, MemoryContext parent, const char *name)
 
void * MemoryContextAlloc (MemoryContext context, Size size)
 
void * MemoryContextAllocZero (MemoryContext context, Size size)
 
void * MemoryContextAllocZeroAligned (MemoryContext context, Size size)
 
void * MemoryContextAllocExtended (MemoryContext context, Size size, int flags)
 
void HandleLogMemoryContextInterrupt (void)
 
void ProcessLogMemoryContextInterrupt (void)
 
void * palloc (Size size)
 
void * palloc0 (Size size)
 
void * palloc_extended (Size size, int flags)
 
void pfree (void *pointer)
 
void * repalloc (void *pointer, Size size)
 
void * MemoryContextAllocHuge (MemoryContext context, Size size)
 
void * repalloc_huge (void *pointer, Size size)
 
char * MemoryContextStrdup (MemoryContext context, const char *string)
 
char * pstrdup (const char *in)
 
char * pnstrdup (const char *in, Size len)
 
char * pchomp (const char *in)
 

Variables

MemoryContext CurrentMemoryContext = NULL
 
MemoryContext TopMemoryContext = NULL
 
MemoryContext ErrorContext = NULL
 
MemoryContext PostmasterContext = NULL
 
MemoryContext CacheMemoryContext = NULL
 
MemoryContext MessageContext = NULL
 
MemoryContext TopTransactionContext = NULL
 
MemoryContext CurTransactionContext = NULL
 
MemoryContext PortalContext = NULL
 

Macro Definition Documentation

◆ AssertNotInCriticalSection

#define AssertNotInCriticalSection (   context)    Assert(CritSectionCount == 0 || (context)->allowInCritSection)

Function Documentation

◆ GetMemoryChunkSpace()

◆ HandleLogMemoryContextInterrupt()

void HandleLogMemoryContextInterrupt ( void  )

Definition at line 1024 of file mcxt.c.

References InterruptPending, and LogMemoryContextPending.

Referenced by GetMemoryChunkContext(), and procsignal_sigusr1_handler().

1025 {
1026  InterruptPending = true;
1027  LogMemoryContextPending = true;
1028  /* latch will be set by procsignal_sigusr1_handler */
1029 }
volatile sig_atomic_t LogMemoryContextPending
Definition: globals.c:38
volatile sig_atomic_t InterruptPending
Definition: globals.c:30

◆ MemoryContextAlloc()

void* MemoryContextAlloc ( MemoryContext  context,
Size  size 
)

Definition at line 863 of file mcxt.c.

References MemoryContextMethods::alloc, AllocSizeIsValid, AssertArg, AssertNotInCriticalSection, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, MemoryContextData::isReset, MemoryContextIsValid, MemoryContextStats(), MemoryContextData::methods, MemoryContextData::name, unlikely, and VALGRIND_MEMPOOL_ALLOC.

Referenced by _bt_getroot(), _bt_getrootheight(), _bt_metaversion(), _fdvec_resize(), _hash_getcachedmetap(), AddInvalidationMessage(), afterTriggerAddEvent(), AfterTriggerBeginSubXact(), AfterTriggerEnlargeQueryState(), allocate_record_info(), array_fill_internal(), array_in(), array_out(), array_position_common(), array_positions(), array_recv(), array_send(), array_to_text_internal(), Async_Notify(), AtSubCommit_childXids(), be_tls_open_server(), bt_check_level_from_leftmost(), build_concat_foutcache(), build_dummy_expanded_header(), check_foreign_key(), check_primary_key(), compute_array_stats(), copy_byval_expanded_array(), CopySnapshot(), dblink_connect(), dblink_init(), deconstruct_expanded_record(), dense_alloc(), do_start_bgworker(), domain_state_setup(), dsm_create_descriptor(), dsm_impl_sysv(), DynaHashAlloc(), enlarge_list(), EventTriggerBeginCompleteQuery(), ExecHashBuildSkewHash(), ExecHashSkewTableInsert(), ExecParallelRetrieveJitInstrumentation(), ExecSetSlotDescriptor(), expand_array(), fetch_array_arg_replace_nulls(), get_attribute_options(), get_multirange_io_data(), get_range_io_data(), get_tablespace(), get_tabstat_stack_level(), GetComboCommandId(), GetFdwRoutineForRelation(), GetLocalBufferStorage(), GetLockConflicts(), gtrgm_consistent(), gtrgm_distance(), gtrgm_penalty(), hash_record(), hash_record_extended(), hstore_from_record(), hstore_populate_record(), initArrayResult(), initArrayResultAny(), initBloomState(), initialize_hash_entry(), initialize_reloptions(), InitializeClientEncoding(), InitializeParallelDSM(), InitIndexAmRoutine(), InitXLogInsert(), insertStatEntry(), intset_new_internal_node(), intset_new_leaf_node(), inv_open(), list_delete_nth_cell(), llvm_compile_module(), load_domaintype_info(), load_relcache_init_file(), LockAcquireExtended(), logical_rewrite_log_mapping(), lookup_ts_config_cache(), make_expanded_record_from_exprecord(), make_expanded_record_from_tupdesc(), make_expanded_record_from_typeid(), makeBoolAggState(), MemoryContextStrdup(), mergeruns(), mXactCachePut(), on_dsm_detach(), packGraph(), PageSetChecksumCopy(), pg_column_compression(), pg_column_size(), pg_newlocale_from_collation(), pg_snapshot_xip(), pg_stat_get_backend_idset(), pgstat_read_current_status(), plpgsql_create_econtext(), plpgsql_start_datums(), PLy_push_execution_context(), PLy_subtransaction_enter(), PortalSetResultFormat(), pq_init(), PrepareClientEncoding(), PrepareSortSupportComparisonShim(), PrepareTempTablespaces(), PushActiveSnapshot(), px_find_digest(), queue_listen(), readtup_alloc(), record_cmp(), record_eq(), record_image_cmp(), record_image_eq(), record_in(), record_out(), record_recv(), record_send(), RegisterExprContextCallback(), RegisterResourceReleaseCallback(), RegisterSubXactCallback(), RegisterXactCallback(), RelationBuildRuleLock(), RelationCreateStorage(), RelationDropStorage(), RelationParseRelOptions(), ReorderBufferAllocate(), ReorderBufferGetChange(), ReorderBufferGetRelids(), ReorderBufferGetTupleBuf(), ReorderBufferGetTXN(), ReorderBufferRestoreChange(), ReorderBufferSerializeReserve(), RequestNamedLWLockTranche(), ResourceArrayEnlarge(), RestoreSnapshot(), setop_fill_hash_table(), setup_background_workers(), shm_mq_receive(), SnapBuildPurgeCommittedTxn(), SPI_connect_ext(), SPI_palloc(), sts_read_tuple(), tbm_begin_iterate(), test_enc_conversion(), tstoreStartupReceiver(), tts_virtual_materialize(), varstrfastcmp_locale(), and xml_is_document().

864 {
865  void *ret;
866 
869 
870  if (!AllocSizeIsValid(size))
871  elog(ERROR, "invalid memory alloc request size %zu", size);
872 
873  context->isReset = false;
874 
875  ret = context->methods->alloc(context, size);
876  if (unlikely(ret == NULL))
877  {
879 
880  /*
881  * Here, and elsewhere in this module, we show the target context's
882  * "name" but not its "ident" (if any) in user-visible error messages.
883  * The "ident" string might contain security-sensitive data, such as
884  * values in SQL commands.
885  */
886  ereport(ERROR,
887  (errcode(ERRCODE_OUT_OF_MEMORY),
888  errmsg("out of memory"),
889  errdetail("Failed on request of size %zu in memory context \"%s\".",
890  size, context->name)));
891  }
892 
893  VALGRIND_MEMPOOL_ALLOC(context, ret, size);
894 
895  return ret;
896 }
const MemoryContextMethods * methods
Definition: memnodes.h:85
int errcode(int sqlerrcode)
Definition: elog.c:698
#define AssertNotInCriticalSection(context)
Definition: mcxt.c:73
#define ERROR
Definition: elog.h:46
void MemoryContextStats(MemoryContext context)
Definition: mcxt.c:505
int errdetail(const char *fmt,...)
Definition: elog.c:1042
void *(* alloc)(MemoryContext context, Size size)
Definition: memnodes.h:60
#define AssertArg(condition)
Definition: c.h:806
MemoryContext TopMemoryContext
Definition: mcxt.c:48
#define AllocSizeIsValid(size)
Definition: memutils.h:42
#define ereport(elevel,...)
Definition: elog.h:157
#define MemoryContextIsValid(context)
Definition: memnodes.h:104
#define VALGRIND_MEMPOOL_ALLOC(context, addr, size)
Definition: memdebug.h:29
int errmsg(const char *fmt,...)
Definition: elog.c:909
#define elog(elevel,...)
Definition: elog.h:232
#define unlikely(x)
Definition: c.h:273
const char * name
Definition: memnodes.h:90

◆ MemoryContextAllocExtended()

void* MemoryContextAllocExtended ( MemoryContext  context,
Size  size,
int  flags 
)

Definition at line 979 of file mcxt.c.

References MemoryContextMethods::alloc, AllocHugeSizeIsValid, AllocSizeIsValid, AssertArg, AssertNotInCriticalSection, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, MemoryContextData::isReset, MCXT_ALLOC_HUGE, MCXT_ALLOC_NO_OOM, MCXT_ALLOC_ZERO, MemoryContextIsValid, MemoryContextStats(), MemSetAligned, MemoryContextData::methods, MemoryContextData::name, unlikely, and VALGRIND_MEMPOOL_ALLOC.

Referenced by pagetable_allocate().

980 {
981  void *ret;
982 
985 
986  if (((flags & MCXT_ALLOC_HUGE) != 0 && !AllocHugeSizeIsValid(size)) ||
987  ((flags & MCXT_ALLOC_HUGE) == 0 && !AllocSizeIsValid(size)))
988  elog(ERROR, "invalid memory alloc request size %zu", size);
989 
990  context->isReset = false;
991 
992  ret = context->methods->alloc(context, size);
993  if (unlikely(ret == NULL))
994  {
995  if ((flags & MCXT_ALLOC_NO_OOM) == 0)
996  {
998  ereport(ERROR,
999  (errcode(ERRCODE_OUT_OF_MEMORY),
1000  errmsg("out of memory"),
1001  errdetail("Failed on request of size %zu in memory context \"%s\".",
1002  size, context->name)));
1003  }
1004  return NULL;
1005  }
1006 
1007  VALGRIND_MEMPOOL_ALLOC(context, ret, size);
1008 
1009  if ((flags & MCXT_ALLOC_ZERO) != 0)
1010  MemSetAligned(ret, 0, size);
1011 
1012  return ret;
1013 }
#define MemSetAligned(start, val, len)
Definition: c.h:1041
#define MCXT_ALLOC_HUGE
Definition: fe_memutils.h:16
const MemoryContextMethods * methods
Definition: memnodes.h:85
#define MCXT_ALLOC_NO_OOM
Definition: fe_memutils.h:18
int errcode(int sqlerrcode)
Definition: elog.c:698
#define AssertNotInCriticalSection(context)
Definition: mcxt.c:73
#define ERROR
Definition: elog.h:46
void MemoryContextStats(MemoryContext context)
Definition: mcxt.c:505
int errdetail(const char *fmt,...)
Definition: elog.c:1042
void *(* alloc)(MemoryContext context, Size size)
Definition: memnodes.h:60
#define AssertArg(condition)
Definition: c.h:806
MemoryContext TopMemoryContext
Definition: mcxt.c:48
#define AllocSizeIsValid(size)
Definition: memutils.h:42
#define ereport(elevel,...)
Definition: elog.h:157
#define MemoryContextIsValid(context)
Definition: memnodes.h:104
#define VALGRIND_MEMPOOL_ALLOC(context, addr, size)
Definition: memdebug.h:29
#define MCXT_ALLOC_ZERO
Definition: fe_memutils.h:19
#define AllocHugeSizeIsValid(size)
Definition: memutils.h:46
int errmsg(const char *fmt,...)
Definition: elog.c:909
#define elog(elevel,...)
Definition: elog.h:232
#define unlikely(x)
Definition: c.h:273
const char * name
Definition: memnodes.h:90

◆ MemoryContextAllocHuge()

void* MemoryContextAllocHuge ( MemoryContext  context,
Size  size 
)

Definition at line 1218 of file mcxt.c.

References MemoryContextMethods::alloc, AllocHugeSizeIsValid, AssertArg, AssertNotInCriticalSection, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, MemoryContextData::isReset, MemoryContextIsValid, MemoryContextStats(), MemoryContextData::methods, MemoryContextData::name, unlikely, and VALGRIND_MEMPOOL_ALLOC.

Referenced by perform_default_encoding_conversion(), pg_buffercache_pages(), pg_do_encoding_conversion(), and pgstat_read_current_status().

1219 {
1220  void *ret;
1221 
1222  AssertArg(MemoryContextIsValid(context));
1223  AssertNotInCriticalSection(context);
1224 
1225  if (!AllocHugeSizeIsValid(size))
1226  elog(ERROR, "invalid memory alloc request size %zu", size);
1227 
1228  context->isReset = false;
1229 
1230  ret = context->methods->alloc(context, size);
1231  if (unlikely(ret == NULL))
1232  {
1234  ereport(ERROR,
1235  (errcode(ERRCODE_OUT_OF_MEMORY),
1236  errmsg("out of memory"),
1237  errdetail("Failed on request of size %zu in memory context \"%s\".",
1238  size, context->name)));
1239  }
1240 
1241  VALGRIND_MEMPOOL_ALLOC(context, ret, size);
1242 
1243  return ret;
1244 }
const MemoryContextMethods * methods
Definition: memnodes.h:85
int errcode(int sqlerrcode)
Definition: elog.c:698
#define AssertNotInCriticalSection(context)
Definition: mcxt.c:73
#define ERROR
Definition: elog.h:46
void MemoryContextStats(MemoryContext context)
Definition: mcxt.c:505
int errdetail(const char *fmt,...)
Definition: elog.c:1042
void *(* alloc)(MemoryContext context, Size size)
Definition: memnodes.h:60
#define AssertArg(condition)
Definition: c.h:806
MemoryContext TopMemoryContext
Definition: mcxt.c:48
#define ereport(elevel,...)
Definition: elog.h:157
#define MemoryContextIsValid(context)
Definition: memnodes.h:104
#define VALGRIND_MEMPOOL_ALLOC(context, addr, size)
Definition: memdebug.h:29
#define AllocHugeSizeIsValid(size)
Definition: memutils.h:46
int errmsg(const char *fmt,...)
Definition: elog.c:909
#define elog(elevel,...)
Definition: elog.h:232
#define unlikely(x)
Definition: c.h:273
const char * name
Definition: memnodes.h:90

◆ MemoryContextAllocZero()

void* MemoryContextAllocZero ( MemoryContext  context,
Size  size 
)

Definition at line 906 of file mcxt.c.

References MemoryContextMethods::alloc, AllocSizeIsValid, AssertArg, AssertNotInCriticalSection, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, MemoryContextData::isReset, MemoryContextIsValid, MemoryContextStats(), MemSetAligned, MemoryContextData::methods, MemoryContextData::name, unlikely, and VALGRIND_MEMPOOL_ALLOC.

Referenced by add_tabstat_xact_level(), AllocateAttribute(), array_set_element_expanded(), AttrDefaultFetch(), CheckConstraintFetch(), ClientAuthentication(), CreatePortal(), CreateWaitEventSet(), DCH_cache_getnew(), do_compile(), ensure_record_cache_typmod_slot_exists(), ExecHashBuildSkewHash(), ExecParallelRetrieveJitInstrumentation(), expandColorTrigrams(), fmgr_security_definer(), get_tabstat_entry(), gistAllocateNewPageBuffer(), init_MultiFuncCall(), initArrayResultArr(), InitializeSession(), InitXLogInsert(), llvm_create_context(), load_relcache_init_file(), LookupOpclassInfo(), LWLockRegisterTranche(), make_expanded_record_from_datum(), newLOfd(), NUM_cache_getnew(), pg_decode_begin_prepare_txn(), pg_decode_begin_txn(), pg_decode_stream_start(), pgstat_read_statsfiles(), PLy_exec_function(), PLy_function_save_args(), PLy_input_setup_func(), PLy_input_setup_tuple(), PLy_output_setup_func(), PLy_output_setup_tuple(), populate_record_worker(), populate_recordset_worker(), prepare_column_cache(), PrepareInvalidationState(), push_old_value(), PushTransaction(), px_find_cipher(), RehashCatCache(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationBuildRowSecurity(), RelationBuildTupleDesc(), RelationInitIndexAccessInfo(), ReorderBufferCopySnap(), ReorderBufferIterTXNInit(), ReorderBufferRestoreChange(), ResourceOwnerCreate(), satisfies_hash_partition(), secure_open_gssapi(), SetConstraintStateCreate(), SnapBuildBuildSnapshot(), SnapBuildRestore(), SnapBuildSerialize(), spgGetCache(), sts_puttuple(), ts_accum(), ts_stat_sql(), and WinGetPartitionLocalMemory().

907 {
908  void *ret;
909 
912 
913  if (!AllocSizeIsValid(size))
914  elog(ERROR, "invalid memory alloc request size %zu", size);
915 
916  context->isReset = false;
917 
918  ret = context->methods->alloc(context, size);
919  if (unlikely(ret == NULL))
920  {
922  ereport(ERROR,
923  (errcode(ERRCODE_OUT_OF_MEMORY),
924  errmsg("out of memory"),
925  errdetail("Failed on request of size %zu in memory context \"%s\".",
926  size, context->name)));
927  }
928 
929  VALGRIND_MEMPOOL_ALLOC(context, ret, size);
930 
931  MemSetAligned(ret, 0, size);
932 
933  return ret;
934 }
#define MemSetAligned(start, val, len)
Definition: c.h:1041
const MemoryContextMethods * methods
Definition: memnodes.h:85
int errcode(int sqlerrcode)
Definition: elog.c:698
#define AssertNotInCriticalSection(context)
Definition: mcxt.c:73
#define ERROR
Definition: elog.h:46
void MemoryContextStats(MemoryContext context)
Definition: mcxt.c:505
int errdetail(const char *fmt,...)
Definition: elog.c:1042
void *(* alloc)(MemoryContext context, Size size)
Definition: memnodes.h:60
#define AssertArg(condition)
Definition: c.h:806
MemoryContext TopMemoryContext
Definition: mcxt.c:48
#define AllocSizeIsValid(size)
Definition: memutils.h:42
#define ereport(elevel,...)
Definition: elog.h:157
#define MemoryContextIsValid(context)
Definition: memnodes.h:104
#define VALGRIND_MEMPOOL_ALLOC(context, addr, size)
Definition: memdebug.h:29
int errmsg(const char *fmt,...)
Definition: elog.c:909
#define elog(elevel,...)
Definition: elog.h:232
#define unlikely(x)
Definition: c.h:273
const char * name
Definition: memnodes.h:90

◆ MemoryContextAllocZeroAligned()

void* MemoryContextAllocZeroAligned ( MemoryContext  context,
Size  size 
)

Definition at line 944 of file mcxt.c.

References MemoryContextMethods::alloc, AllocSizeIsValid, AssertArg, AssertNotInCriticalSection, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, MemoryContextData::isReset, MemoryContextIsValid, MemoryContextStats(), MemSetLoop, MemoryContextData::methods, MemoryContextData::name, unlikely, and VALGRIND_MEMPOOL_ALLOC.

945 {
946  void *ret;
947 
950 
951  if (!AllocSizeIsValid(size))
952  elog(ERROR, "invalid memory alloc request size %zu", size);
953 
954  context->isReset = false;
955 
956  ret = context->methods->alloc(context, size);
957  if (unlikely(ret == NULL))
958  {
960  ereport(ERROR,
961  (errcode(ERRCODE_OUT_OF_MEMORY),
962  errmsg("out of memory"),
963  errdetail("Failed on request of size %zu in memory context \"%s\".",
964  size, context->name)));
965  }
966 
967  VALGRIND_MEMPOOL_ALLOC(context, ret, size);
968 
969  MemSetLoop(ret, 0, size);
970 
971  return ret;
972 }
const MemoryContextMethods * methods
Definition: memnodes.h:85
int errcode(int sqlerrcode)
Definition: elog.c:698
#define AssertNotInCriticalSection(context)
Definition: mcxt.c:73
#define ERROR
Definition: elog.h:46
void MemoryContextStats(MemoryContext context)
Definition: mcxt.c:505
#define MemSetLoop(start, val, len)
Definition: c.h:1076
int errdetail(const char *fmt,...)
Definition: elog.c:1042
void *(* alloc)(MemoryContext context, Size size)
Definition: memnodes.h:60
#define AssertArg(condition)
Definition: c.h:806
MemoryContext TopMemoryContext
Definition: mcxt.c:48
#define AllocSizeIsValid(size)
Definition: memutils.h:42
#define ereport(elevel,...)
Definition: elog.h:157
#define MemoryContextIsValid(context)
Definition: memnodes.h:104
#define VALGRIND_MEMPOOL_ALLOC(context, addr, size)
Definition: memdebug.h:29
int errmsg(const char *fmt,...)
Definition: elog.c:909
#define elog(elevel,...)
Definition: elog.h:232
#define unlikely(x)
Definition: c.h:273
const char * name
Definition: memnodes.h:90

◆ MemoryContextAllowInCriticalSection()

void MemoryContextAllowInCriticalSection ( MemoryContext  context,
bool  allow 
)

Definition at line 418 of file mcxt.c.

References MemoryContextData::allowInCritSection, AssertArg, and MemoryContextIsValid.

Referenced by InitSync(), MemoryContextInit(), and XLOGShmemInit().

419 {
421 
422  context->allowInCritSection = allow;
423 }
bool allowInCritSection
Definition: memnodes.h:83
#define AssertArg(condition)
Definition: c.h:806
#define MemoryContextIsValid(context)
Definition: memnodes.h:104

◆ MemoryContextCallResetCallbacks()

static void MemoryContextCallResetCallbacks ( MemoryContext  context)
static

Definition at line 309 of file mcxt.c.

References MemoryContextCallback::arg, MemoryContextCallback::func, MemoryContextCallback::next, and MemoryContextData::reset_cbs.

Referenced by MemoryContextDelete(), and MemoryContextResetOnly().

310 {
312 
313  /*
314  * We pop each callback from the list before calling. That way, if an
315  * error occurs inside the callback, we won't try to call it a second time
316  * in the likely event that we reset or delete the context later.
317  */
318  while ((cb = context->reset_cbs) != NULL)
319  {
320  context->reset_cbs = cb->next;
321  cb->func(cb->arg);
322  }
323 }
MemoryContextCallbackFunction func
Definition: palloc.h:49
MemoryContextCallback * reset_cbs
Definition: memnodes.h:92
struct MemoryContextCallback * next
Definition: palloc.h:51

◆ MemoryContextContains()

bool MemoryContextContains ( MemoryContext  context,
void *  pointer 
)

Definition at line 758 of file mcxt.c.

References MAXALIGN.

Referenced by eval_windowfunction(), finalize_aggregate(), finalize_partialaggregate(), and finalize_windowaggregate().

759 {
760  MemoryContext ptr_context;
761 
762  /*
763  * NB: Can't use GetMemoryChunkContext() here - that performs assertions
764  * that aren't acceptable here since we might be passed memory not
765  * allocated by any memory context.
766  *
767  * Try to detect bogus pointers handed to us, poorly though we can.
768  * Presumably, a pointer that isn't MAXALIGNED isn't pointing at an
769  * allocated chunk.
770  */
771  if (pointer == NULL || pointer != (void *) MAXALIGN(pointer))
772  return false;
773 
774  /*
775  * OK, it's probably safe to look at the context.
776  */
777  ptr_context = *(MemoryContext *) (((char *) pointer) - sizeof(void *));
778 
779  return ptr_context == context;
780 }
#define MAXALIGN(LEN)
Definition: c.h:757

◆ MemoryContextCreate()

void MemoryContextCreate ( MemoryContext  node,
NodeTag  tag,
const MemoryContextMethods methods,
MemoryContext  parent,
const char *  name 
)

Definition at line 815 of file mcxt.c.

References MemoryContextData::allowInCritSection, Assert, CritSectionCount, MemoryContextData::firstchild, MemoryContextData::ident, MemoryContextData::isReset, MemoryContextData::mem_allocated, MemoryContextData::methods, MemoryContextData::name, name, MemoryContextData::nextchild, MemoryContextData::parent, MemoryContextData::prevchild, MemoryContextData::reset_cbs, MemoryContextData::type, and VALGRIND_CREATE_MEMPOOL.

Referenced by AllocSetContextCreateInternal(), GenerationContextCreate(), GetMemoryChunkContext(), and SlabContextCreate().

820 {
821  /* Creating new memory contexts is not allowed in a critical section */
822  Assert(CritSectionCount == 0);
823 
824  /* Initialize all standard fields of memory context header */
825  node->type = tag;
826  node->isReset = true;
827  node->methods = methods;
828  node->parent = parent;
829  node->firstchild = NULL;
830  node->mem_allocated = 0;
831  node->prevchild = NULL;
832  node->name = name;
833  node->ident = NULL;
834  node->reset_cbs = NULL;
835 
836  /* OK to link node into context tree */
837  if (parent)
838  {
839  node->nextchild = parent->firstchild;
840  if (parent->firstchild != NULL)
841  parent->firstchild->prevchild = node;
842  parent->firstchild = node;
843  /* inherit allowInCritSection flag from parent */
844  node->allowInCritSection = parent->allowInCritSection;
845  }
846  else
847  {
848  node->nextchild = NULL;
849  node->allowInCritSection = false;
850  }
851 
852  VALGRIND_CREATE_MEMPOOL(node, 0, false);
853 }
MemoryContextCallback * reset_cbs
Definition: memnodes.h:92
const MemoryContextMethods * methods
Definition: memnodes.h:85
bool allowInCritSection
Definition: memnodes.h:83
MemoryContext firstchild
Definition: memnodes.h:87
MemoryContext prevchild
Definition: memnodes.h:88
volatile uint32 CritSectionCount
Definition: globals.c:41
const char * ident
Definition: memnodes.h:91
#define VALGRIND_CREATE_MEMPOOL(context, redzones, zeroed)
Definition: memdebug.h:24
#define Assert(condition)
Definition: c.h:804
const char * name
Definition: encode.c:515
Size mem_allocated
Definition: memnodes.h:84
MemoryContext parent
Definition: memnodes.h:86
const char * name
Definition: memnodes.h:90
MemoryContext nextchild
Definition: memnodes.h:89
NodeTag type
Definition: memnodes.h:80

◆ MemoryContextDelete()

void MemoryContextDelete ( MemoryContext  context)

Definition at line 218 of file mcxt.c.

References Assert, AssertArg, MemoryContextMethods::delete_context, MemoryContextData::firstchild, MemoryContextData::ident, MemoryContextCallResetCallbacks(), MemoryContextDeleteChildren(), MemoryContextIsValid, MemoryContextSetParent(), MemoryContextData::methods, and VALGRIND_DESTROY_MEMPOOL.

Referenced by AfterTriggerEndXact(), afterTriggerInvokeEvents(), ApplyLauncherMain(), AtCleanup_Memory(), AtCommit_Memory(), AtEOSubXact_SPI(), AtEOXact_LargeObject(), AtSubCleanup_Memory(), AtSubCommit_Memory(), AttachPartitionEnsureIndexes(), blbuild(), blinsert(), brin_free_desc(), brin_minmax_multi_union(), bringetbitmap(), brininsert(), bt_check_every_level(), btendscan(), btree_xlog_cleanup(), btvacuumscan(), BuildParamLogString(), BuildRelationExtStatistics(), CloneRowTriggersToPartition(), cluster(), compactify_ranges(), compile_plperl_function(), compile_pltcl_function(), compute_expr_stats(), compute_index_stats(), ComputeExtStatisticsRows(), createTrgmNFA(), CreateTrigger(), decr_dcc_refcount(), DeleteExpandedObject(), DiscreteKnapsack(), do_analyze_rel(), do_start_bgworker(), do_start_worker(), DoCopyTo(), DropCachedPlan(), each_worker(), each_worker_jsonb(), elements_worker(), elements_worker_jsonb(), end_heap_rewrite(), EndCopy(), EndCopyFrom(), ensure_free_space_in_buffer(), EventTriggerEndCompleteQuery(), EventTriggerInvoke(), exec_replication_command(), exec_simple_query(), ExecEndAgg(), ExecEndRecursiveUnion(), ExecEndResultCache(), ExecEndSetOp(), ExecEndWindowAgg(), ExecHashTableDestroy(), execute_sql_string(), file_acquire_sample_rows(), fill_hba_view(), fmgr_sql(), free_plperl_function(), FreeCachedExpression(), FreeDecodingContext(), FreeExecutorState(), FreeExprContext(), freeGISTstate(), FreeSnapshotBuilder(), geqo_eval(), get_actual_variable_range(), gin_xlog_cleanup(), ginbuild(), ginbulkdelete(), ginendscan(), gininsert(), ginInsertCleanup(), ginPlaceToPage(), gist_xlog_cleanup(), gistbuild(), gistvacuumscan(), hash_destroy(), inline_function(), inline_set_returning_function(), libpqrcv_processTuples(), load_hba(), load_ident(), load_tzoffsets(), makeArrayResultArr(), makeMdArrayResult(), MemoryContextDeleteChildren(), NIFinishBuild(), pg_decode_shutdown(), pgstat_clear_backend_activity_snapshot(), pgstat_clear_snapshot(), plperl_spi_freeplan(), plperl_spi_prepare(), plpgsql_free_function_memory(), pltcl_handler(), pltcl_SPI_prepare(), PLy_cursor_dealloc(), PLy_plan_dealloc(), PLy_pop_execution_context(), PLy_procedure_delete(), PLy_spi_execute_fetch_result(), PortalDrop(), PostgresMain(), printtup_shutdown(), publicationListToArray(), rebuild_database_list(), ReindexMultipleTables(), ReindexPartitions(), ReindexRelationConcurrently(), RelationBuildDesc(), RelationBuildRuleLock(), RelationDestroyRelation(), ReleaseCachedPlan(), ReorderBufferFree(), ResetUnloggedRelations(), RevalidateCachedQuery(), shutdown_MultiFuncCall(), spg_xlog_cleanup(), spgbuild(), spgendscan(), spginsert(), SPI_finish(), SPI_freeplan(), SPI_freetuptable(), StartChildProcess(), strlist_to_textarray(), test_pattern(), tokenize_inc_file(), tuplesort_end(), union_tuples(), vacuum(), and validateForeignKeyConstraint().

219 {
221  /* We had better not be deleting TopMemoryContext ... */
222  Assert(context != TopMemoryContext);
223  /* And not CurrentMemoryContext, either */
224  Assert(context != CurrentMemoryContext);
225 
226  /* save a function call in common case where there are no children */
227  if (context->firstchild != NULL)
229 
230  /*
231  * It's not entirely clear whether 'tis better to do this before or after
232  * delinking the context; but an error in a callback will likely result in
233  * leaking the whole context (if it's not a root context) if we do it
234  * after, so let's do it before.
235  */
237 
238  /*
239  * We delink the context from its parent before deleting it, so that if
240  * there's an error we won't have deleted/busted contexts still attached
241  * to the context tree. Better a leak than a crash.
242  */
243  MemoryContextSetParent(context, NULL);
244 
245  /*
246  * Also reset the context's ident pointer, in case it points into the
247  * context. This would only matter if someone tries to get stats on the
248  * (already unlinked) context, which is unlikely, but let's be safe.
249  */
250  context->ident = NULL;
251 
252  context->methods->delete_context(context);
253 
254  VALGRIND_DESTROY_MEMPOOL(context);
255 }
static void MemoryContextCallResetCallbacks(MemoryContext context)
Definition: mcxt.c:309
const MemoryContextMethods * methods
Definition: memnodes.h:85
void MemoryContextSetParent(MemoryContext context, MemoryContext new_parent)
Definition: mcxt.c:361
MemoryContext firstchild
Definition: memnodes.h:87
MemoryContext CurrentMemoryContext
Definition: mcxt.c:42
#define AssertArg(condition)
Definition: c.h:806
const char * ident
Definition: memnodes.h:91
MemoryContext TopMemoryContext
Definition: mcxt.c:48
void MemoryContextDeleteChildren(MemoryContext context)
Definition: mcxt.c:263
#define VALGRIND_DESTROY_MEMPOOL(context)
Definition: memdebug.h:25
#define MemoryContextIsValid(context)
Definition: memnodes.h:104
#define Assert(condition)
Definition: c.h:804
void(* delete_context)(MemoryContext context)
Definition: memnodes.h:65

◆ MemoryContextDeleteChildren()

void MemoryContextDeleteChildren ( MemoryContext  context)

Definition at line 263 of file mcxt.c.

References AssertArg, MemoryContextData::firstchild, MemoryContextDelete(), and MemoryContextIsValid.

Referenced by AtAbort_Portals(), AtSubAbort_Portals(), exec_stmt_block(), MemoryContextDelete(), MemoryContextReset(), PersistHoldablePortal(), PortalRunMulti(), and RelationClose().

264 {
266 
267  /*
268  * MemoryContextDelete will delink the child from me, so just iterate as
269  * long as there is a child.
270  */
271  while (context->firstchild != NULL)
273 }
void MemoryContextDelete(MemoryContext context)
Definition: mcxt.c:218
MemoryContext firstchild
Definition: memnodes.h:87
#define AssertArg(condition)
Definition: c.h:806
#define MemoryContextIsValid(context)
Definition: memnodes.h:104

◆ MemoryContextGetParent()

MemoryContext MemoryContextGetParent ( MemoryContext  context)

Definition at line 446 of file mcxt.c.

References AssertArg, MemoryContextIsValid, and MemoryContextData::parent.

Referenced by advance_windowaggregate(), advance_windowaggregate_base(), ExecAggTransReparent(), GetCachedPlan(), pop_stmt_mcontext(), and push_stmt_mcontext().

447 {
449 
450  return context->parent;
451 }
#define AssertArg(condition)
Definition: c.h:806
#define MemoryContextIsValid(context)
Definition: memnodes.h:104
MemoryContext parent
Definition: memnodes.h:86

◆ MemoryContextInit()

void MemoryContextInit ( void  )

Definition at line 99 of file mcxt.c.

References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, AssertState, MemoryContextAllowInCriticalSection(), and TopMemoryContext.

Referenced by main().

100 {
101  AssertState(TopMemoryContext == NULL);
102 
103  /*
104  * First, initialize TopMemoryContext, which is the parent of all others.
105  */
107  "TopMemoryContext",
109 
110  /*
111  * Not having any other place to point CurrentMemoryContext, make it point
112  * to TopMemoryContext. Caller should change this soon!
113  */
115 
116  /*
117  * Initialize ErrorContext as an AllocSetContext with slow growth rate ---
118  * we don't really expect much to be allocated in it. More to the point,
119  * require it to contain at least 8K at all times. This is the only case
120  * where retained memory in a context is *essential* --- we want to be
121  * sure ErrorContext still has some memory even if we've run out
122  * elsewhere! Also, allow allocations in ErrorContext within a critical
123  * section. Otherwise a PANIC will cause an assertion failure in the error
124  * reporting code, before printing out the real cause of the failure.
125  *
126  * This should be the last step in this function, as elog.c assumes memory
127  * management works once ErrorContext is non-null.
128  */
130  "ErrorContext",
131  8 * 1024,
132  8 * 1024,
133  8 * 1024);
135 }
#define AllocSetContextCreate
Definition: memutils.h:173
#define AssertState(condition)
Definition: c.h:807
void MemoryContextAllowInCriticalSection(MemoryContext context, bool allow)
Definition: mcxt.c:418
MemoryContext ErrorContext
Definition: mcxt.c:49
#define ALLOCSET_DEFAULT_SIZES
Definition: memutils.h:195
MemoryContext CurrentMemoryContext
Definition: mcxt.c:42
MemoryContext TopMemoryContext
Definition: mcxt.c:48

◆ MemoryContextIsEmpty()

bool MemoryContextIsEmpty ( MemoryContext  context)

Definition at line 458 of file mcxt.c.

References AssertArg, MemoryContextData::firstchild, MemoryContextMethods::is_empty, MemoryContextIsValid, and MemoryContextData::methods.

Referenced by AtSubCommit_Memory().

459 {
461 
462  /*
463  * For now, we consider a memory context nonempty if it has any children;
464  * perhaps this should be changed later.
465  */
466  if (context->firstchild != NULL)
467  return false;
468  /* Otherwise use the type-specific inquiry */
469  return context->methods->is_empty(context);
470 }
const MemoryContextMethods * methods
Definition: memnodes.h:85
MemoryContext firstchild
Definition: memnodes.h:87
bool(* is_empty)(MemoryContext context)
Definition: memnodes.h:67
#define AssertArg(condition)
Definition: c.h:806
#define MemoryContextIsValid(context)
Definition: memnodes.h:104

◆ MemoryContextMemAllocated()

Size MemoryContextMemAllocated ( MemoryContext  context,
bool  recurse 
)

Definition at line 477 of file mcxt.c.

References AssertArg, MemoryContextData::firstchild, MemoryContextData::mem_allocated, MemoryContextIsValid, MemoryContextMemAllocated(), and MemoryContextData::nextchild.

Referenced by hash_agg_check_limits(), hash_agg_update_metrics(), and MemoryContextMemAllocated().

478 {
479  Size total = context->mem_allocated;
480 
482 
483  if (recurse)
484  {
485  MemoryContext child;
486 
487  for (child = context->firstchild;
488  child != NULL;
489  child = child->nextchild)
490  total += MemoryContextMemAllocated(child, true);
491  }
492 
493  return total;
494 }
MemoryContext firstchild
Definition: memnodes.h:87
#define AssertArg(condition)
Definition: c.h:806
Size MemoryContextMemAllocated(MemoryContext context, bool recurse)
Definition: mcxt.c:477
#define MemoryContextIsValid(context)
Definition: memnodes.h:104
size_t Size
Definition: c.h:540
Size mem_allocated
Definition: memnodes.h:84
MemoryContext nextchild
Definition: memnodes.h:89

◆ MemoryContextRegisterResetCallback()

void MemoryContextRegisterResetCallback ( MemoryContext  context,
MemoryContextCallback cb 
)

Definition at line 292 of file mcxt.c.

References AssertArg, MemoryContextData::isReset, MemoryContextIsValid, MemoryContextCallback::next, and MemoryContextData::reset_cbs.

Referenced by expanded_record_fetch_tupdesc(), InitDomainConstraintRef(), make_expanded_record_from_exprecord(), make_expanded_record_from_tupdesc(), make_expanded_record_from_typeid(), MemoryContextSwitchTo(), NIAddAffix(), and PLy_exec_function().

294 {
296 
297  /* Push onto head so this will be called before older registrants. */
298  cb->next = context->reset_cbs;
299  context->reset_cbs = cb;
300  /* Mark the context as non-reset (it probably is already). */
301  context->isReset = false;
302 }
MemoryContextCallback * reset_cbs
Definition: memnodes.h:92
#define AssertArg(condition)
Definition: c.h:806
#define MemoryContextIsValid(context)
Definition: memnodes.h:104
struct MemoryContextCallback * next
Definition: palloc.h:51

◆ MemoryContextReset()

void MemoryContextReset ( MemoryContext  context)

Definition at line 143 of file mcxt.c.

References AssertArg, MemoryContextData::firstchild, MemoryContextData::isReset, MemoryContextDeleteChildren(), MemoryContextIsValid, and MemoryContextResetOnly().

Referenced by _bt_preprocess_array_keys(), AfterTriggerExecute(), apply_handle_stream_commit(), apply_handle_stream_stop(), bloomBuildCallback(), brin_memtuple_initialize(), bt_check_level_from_leftmost(), btree_redo(), btvacuumpage(), buildSubPlanHash(), check_domain_for_new_field(), check_domain_for_new_tuple(), CloneRowTriggersToPartition(), CopyOneRowTo(), CreateTrigger(), dumptuples(), each_object_field_end(), each_worker_jsonb(), elements_array_element_end(), elements_worker_jsonb(), errstart(), EventTriggerInvoke(), exec_dynquery_with_params(), exec_stmt_block(), exec_stmt_dynexecute(), exec_stmt_forc(), exec_stmt_foreach_a(), exec_stmt_open(), exec_stmt_raise(), exec_stmt_return_query(), ExecFindInitialMatchingSubPlans(), ExecFindMatchingSubPlans(), ExecHashTableReset(), ExecMakeTableFunctionResult(), ExecProjectSet(), ExecQualAndReset(), ExecRecursiveUnion(), execTuplesUnequal(), execute_foreign_modify(), expanded_record_set_field_internal(), expanded_record_set_tuple(), fetch_more_data(), file_acquire_sample_rows(), get_short_term_cxt(), gin_redo(), ginBuildCallback(), ginHeapTupleBulkInsert(), ginInsertCleanup(), ginVacuumPostingTreeLeaves(), gist_indexsortbuild(), gist_redo(), gistBuildCallback(), gistgetbitmap(), gistgettuple(), gistinsert(), gistProcessEmptyingQueue(), gistrescan(), gistScanPage(), gistSortedBuildCallback(), HandleParallelMessages(), heapam_index_build_range_scan(), heapam_index_validate_scan(), IndexCheckExclusion(), keyGetItem(), libpqrcv_processTuples(), LogicalRepApplyLoop(), lookup_ts_dictionary_cache(), make_tuple_from_result_row(), pg_decode_change(), pg_decode_truncate(), pgoutput_change(), pgoutput_truncate(), plperl_return_next_internal(), PLy_input_convert(), PLy_input_from_tuple(), printtup(), process_ordered_aggregate_single(), ReScanExprContext(), resetSpGistScanOpaque(), scanPendingInsert(), sepgsql_avc_reset(), spg_redo(), spginsert(), spgistBuildCallback(), spgWalk(), startScanKey(), storeRow(), tfuncFetchRows(), tfuncLoadRows(), tuplesort_free(), and validateForeignKeyConstraint().

144 {
146 
147  /* save a function call in common case where there are no children */
148  if (context->firstchild != NULL)
150 
151  /* save a function call if no pallocs since startup or last reset */
152  if (!context->isReset)
153  MemoryContextResetOnly(context);
154 }
void MemoryContextResetOnly(MemoryContext context)
Definition: mcxt.c:162
MemoryContext firstchild
Definition: memnodes.h:87
#define AssertArg(condition)
Definition: c.h:806
void MemoryContextDeleteChildren(MemoryContext context)
Definition: mcxt.c:263
#define MemoryContextIsValid(context)
Definition: memnodes.h:104

◆ MemoryContextResetChildren()

void MemoryContextResetChildren ( MemoryContext  context)

Definition at line 195 of file mcxt.c.

References AssertArg, MemoryContextData::firstchild, MemoryContextIsValid, MemoryContextResetChildren(), MemoryContextResetOnly(), and MemoryContextData::nextchild.

Referenced by MemoryContextResetChildren().

196 {
197  MemoryContext child;
198 
200 
201  for (child = context->firstchild; child != NULL; child = child->nextchild)
202  {
204  MemoryContextResetOnly(child);
205  }
206 }
void MemoryContextResetOnly(MemoryContext context)
Definition: mcxt.c:162
MemoryContext firstchild
Definition: memnodes.h:87
#define AssertArg(condition)
Definition: c.h:806
#define MemoryContextIsValid(context)
Definition: memnodes.h:104
void MemoryContextResetChildren(MemoryContext context)
Definition: mcxt.c:195
MemoryContext nextchild
Definition: memnodes.h:89

◆ MemoryContextResetOnly()

void MemoryContextResetOnly ( MemoryContext  context)

Definition at line 162 of file mcxt.c.

References AssertArg, MemoryContextData::isReset, MemoryContextCallResetCallbacks(), MemoryContextIsValid, MemoryContextData::methods, MemoryContextMethods::reset, VALGRIND_CREATE_MEMPOOL, and VALGRIND_DESTROY_MEMPOOL.

Referenced by AllocSetDelete(), MemoryContextReset(), MemoryContextResetChildren(), and mergeruns().

163 {
165 
166  /* Nothing to do if no pallocs since startup or last reset */
167  if (!context->isReset)
168  {
170 
171  /*
172  * If context->ident points into the context's memory, it will become
173  * a dangling pointer. We could prevent that by setting it to NULL
174  * here, but that would break valid coding patterns that keep the
175  * ident elsewhere, e.g. in a parent context. Another idea is to use
176  * MemoryContextContains(), but we don't require ident strings to be
177  * in separately-palloc'd chunks, so that risks false positives. So
178  * for now we assume the programmer got it right.
179  */
180 
181  context->methods->reset(context);
182  context->isReset = true;
183  VALGRIND_DESTROY_MEMPOOL(context);
184  VALGRIND_CREATE_MEMPOOL(context, 0, false);
185  }
186 }
static void MemoryContextCallResetCallbacks(MemoryContext context)
Definition: mcxt.c:309
const MemoryContextMethods * methods
Definition: memnodes.h:85
void(* reset)(MemoryContext context)
Definition: memnodes.h:64
#define AssertArg(condition)
Definition: c.h:806
#define VALGRIND_DESTROY_MEMPOOL(context)
Definition: memdebug.h:25
#define VALGRIND_CREATE_MEMPOOL(context, redzones, zeroed)
Definition: memdebug.h:24
#define MemoryContextIsValid(context)
Definition: memnodes.h:104

◆ MemoryContextSetIdentifier()

void MemoryContextSetIdentifier ( MemoryContext  context,
const char *  id 
)

Definition at line 336 of file mcxt.c.

References AssertArg, MemoryContextData::ident, and MemoryContextIsValid.

Referenced by compile_plperl_function(), compile_pltcl_function(), CopyCachedPlan(), CreateCachedPlan(), CreatePortal(), do_compile(), hash_create(), init_sql_fcache(), lookup_ts_dictionary_cache(), PLy_procedure_create(), and test_pattern().

337 {
339  context->ident = id;
340 }
#define AssertArg(condition)
Definition: c.h:806
const char * ident
Definition: memnodes.h:91
#define MemoryContextIsValid(context)
Definition: memnodes.h:104

◆ MemoryContextSetParent()

void MemoryContextSetParent ( MemoryContext  context,
MemoryContext  new_parent 
)

Definition at line 361 of file mcxt.c.

References Assert, AssertArg, MemoryContextData::firstchild, MemoryContextIsValid, MemoryContextData::nextchild, MemoryContextData::parent, and MemoryContextData::prevchild.

Referenced by _SPI_save_plan(), CachedPlanSetParentContext(), CompleteCachedPlan(), exec_parse_message(), GetCachedExpression(), GetCachedPlan(), load_domaintype_info(), MemoryContextDelete(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationBuildRowSecurity(), RelationClearRelation(), RevalidateCachedQuery(), SaveCachedPlan(), SPI_keepplan(), and TransferExpandedObject().

362 {
364  AssertArg(context != new_parent);
365 
366  /* Fast path if it's got correct parent already */
367  if (new_parent == context->parent)
368  return;
369 
370  /* Delink from existing parent, if any */
371  if (context->parent)
372  {
373  MemoryContext parent = context->parent;
374 
375  if (context->prevchild != NULL)
376  context->prevchild->nextchild = context->nextchild;
377  else
378  {
379  Assert(parent->firstchild == context);
380  parent->firstchild = context->nextchild;
381  }
382 
383  if (context->nextchild != NULL)
384  context->nextchild->prevchild = context->prevchild;
385  }
386 
387  /* And relink */
388  if (new_parent)
389  {
390  AssertArg(MemoryContextIsValid(new_parent));
391  context->parent = new_parent;
392  context->prevchild = NULL;
393  context->nextchild = new_parent->firstchild;
394  if (new_parent->firstchild != NULL)
395  new_parent->firstchild->prevchild = context;
396  new_parent->firstchild = context;
397  }
398  else
399  {
400  context->parent = NULL;
401  context->prevchild = NULL;
402  context->nextchild = NULL;
403  }
404 }
MemoryContext firstchild
Definition: memnodes.h:87
MemoryContext prevchild
Definition: memnodes.h:88
#define AssertArg(condition)
Definition: c.h:806
#define MemoryContextIsValid(context)
Definition: memnodes.h:104
#define Assert(condition)
Definition: c.h:804
MemoryContext parent
Definition: memnodes.h:86
MemoryContext nextchild
Definition: memnodes.h:89

◆ MemoryContextStats()

void MemoryContextStats ( MemoryContext  context)

Definition at line 505 of file mcxt.c.

References MemoryContextStatsDetail().

Referenced by AllocSetContextCreateInternal(), finish_xact_command(), GenerationContextCreate(), MemoryContextAlloc(), MemoryContextAllocExtended(), MemoryContextAllocHuge(), MemoryContextAllocZero(), MemoryContextAllocZeroAligned(), palloc(), palloc0(), palloc_extended(), repalloc(), repalloc_huge(), SlabContextCreate(), and test_pattern().

506 {
507  /* A hard-wired limit on the number of children is usually good enough */
508  MemoryContextStatsDetail(context, 100, true);
509 }
void MemoryContextStatsDetail(MemoryContext context, int max_children, bool print_to_stderr)
Definition: mcxt.c:520

◆ MemoryContextStatsDetail()

void MemoryContextStatsDetail ( MemoryContext  context,
int  max_children,
bool  print_to_stderr 
)

Definition at line 520 of file mcxt.c.

References ereport, errhidecontext(), errhidestmt(), errmsg_internal(), fprintf, MemoryContextCounters::freechunks, MemoryContextCounters::freespace, LOG_SERVER_ONLY, MemoryContextStatsInternal(), MemoryContextCounters::nblocks, and MemoryContextCounters::totalspace.

Referenced by MemoryContextStats(), and ProcessLogMemoryContextInterrupt().

522 {
523  MemoryContextCounters grand_totals;
524 
525  memset(&grand_totals, 0, sizeof(grand_totals));
526 
527  MemoryContextStatsInternal(context, 0, true, max_children, &grand_totals, print_to_stderr);
528 
529  if (print_to_stderr)
530  fprintf(stderr,
531  "Grand total: %zu bytes in %zd blocks; %zu free (%zd chunks); %zu used\n",
532  grand_totals.totalspace, grand_totals.nblocks,
533  grand_totals.freespace, grand_totals.freechunks,
534  grand_totals.totalspace - grand_totals.freespace);
535  else
536 
537  /*
538  * Use LOG_SERVER_ONLY to prevent the memory contexts from being sent
539  * to the connected client.
540  *
541  * We don't buffer the information about all memory contexts in a
542  * backend into StringInfo and log it as one message. Otherwise which
543  * may require the buffer to be enlarged very much and lead to OOM
544  * error since there can be a large number of memory contexts in a
545  * backend. Instead, we log one message per memory context.
546  */
548  (errhidestmt(true),
549  errhidecontext(true),
550  errmsg_internal("Grand total: %zu bytes in %zd blocks; %zu free (%zd chunks); %zu used",
551  grand_totals.totalspace, grand_totals.nblocks,
552  grand_totals.freespace, grand_totals.freechunks,
553  grand_totals.totalspace - grand_totals.freespace)));
554 }
#define LOG_SERVER_ONLY
Definition: elog.h:28
int errhidestmt(bool hide_stmt)
Definition: elog.c:1250
#define fprintf
Definition: port.h:220
static void MemoryContextStatsInternal(MemoryContext context, int level, bool print, int max_children, MemoryContextCounters *totals, bool print_to_stderr)
Definition: mcxt.c:564
#define ereport(elevel,...)
Definition: elog.h:157
int errmsg_internal(const char *fmt,...)
Definition: elog.c:996
int errhidecontext(bool hide_ctx)
Definition: elog.c:1269

◆ MemoryContextStatsInternal()

static void MemoryContextStatsInternal ( MemoryContext  context,
int  level,
bool  print,
int  max_children,
MemoryContextCounters totals,
bool  print_to_stderr 
)
static

Definition at line 564 of file mcxt.c.

References AssertArg, ereport, errhidecontext(), errhidestmt(), errmsg_internal(), MemoryContextData::firstchild, fprintf, MemoryContextCounters::freechunks, MemoryContextCounters::freespace, i, LOG_SERVER_ONLY, MemoryContextIsValid, MemoryContextStatsPrint(), MemoryContextData::methods, MemoryContextCounters::nblocks, MemoryContextData::nextchild, MemoryContextMethods::stats, and MemoryContextCounters::totalspace.

Referenced by MemoryContextStatsDetail().

568 {
569  MemoryContextCounters local_totals;
570  MemoryContext child;
571  int ichild;
572 
574 
575  /* Examine the context itself */
576  context->methods->stats(context,
578  (void *) &level,
579  totals, print_to_stderr);
580 
581  /*
582  * Examine children. If there are more than max_children of them, we do
583  * not print the rest explicitly, but just summarize them.
584  */
585  memset(&local_totals, 0, sizeof(local_totals));
586 
587  for (child = context->firstchild, ichild = 0;
588  child != NULL;
589  child = child->nextchild, ichild++)
590  {
591  if (ichild < max_children)
592  MemoryContextStatsInternal(child, level + 1,
593  print, max_children,
594  totals,
595  print_to_stderr);
596  else
597  MemoryContextStatsInternal(child, level + 1,
598  false, max_children,
599  &local_totals,
600  print_to_stderr);
601  }
602 
603  /* Deal with excess children */
604  if (ichild > max_children)
605  {
606  if (print)
607  {
608  if (print_to_stderr)
609  {
610  int i;
611 
612  for (i = 0; i <= level; i++)
613  fprintf(stderr, " ");
614  fprintf(stderr,
615  "%d more child contexts containing %zu total in %zd blocks; %zu free (%zd chunks); %zu used\n",
616  ichild - max_children,
617  local_totals.totalspace,
618  local_totals.nblocks,
619  local_totals.freespace,
620  local_totals.freechunks,
621  local_totals.totalspace - local_totals.freespace);
622  }
623  else
625  (errhidestmt(true),
626  errhidecontext(true),
627  errmsg_internal("level: %d; %d more child contexts containing %zu total in %zd blocks; %zu free (%zd chunks); %zu used",
628  level,
629  ichild - max_children,
630  local_totals.totalspace,
631  local_totals.nblocks,
632  local_totals.freespace,
633  local_totals.freechunks,
634  local_totals.totalspace - local_totals.freespace)));
635  }
636 
637  if (totals)
638  {
639  totals->nblocks += local_totals.nblocks;
640  totals->freechunks += local_totals.freechunks;
641  totals->totalspace += local_totals.totalspace;
642  totals->freespace += local_totals.freespace;
643  }
644  }
645 }
void(* stats)(MemoryContext context, MemoryStatsPrintFunc printfunc, void *passthru, MemoryContextCounters *totals, bool print_to_stderr)
Definition: memnodes.h:68
#define LOG_SERVER_ONLY
Definition: elog.h:28
void print(const void *obj)
Definition: print.c:36
const MemoryContextMethods * methods
Definition: memnodes.h:85
int errhidestmt(bool hide_stmt)
Definition: elog.c:1250
#define fprintf
Definition: port.h:220
static void MemoryContextStatsInternal(MemoryContext context, int level, bool print, int max_children, MemoryContextCounters *totals, bool print_to_stderr)
Definition: mcxt.c:564
MemoryContext firstchild
Definition: memnodes.h:87
#define AssertArg(condition)
Definition: c.h:806
static void MemoryContextStatsPrint(MemoryContext context, void *passthru, const char *stats_string, bool print_to_stderr)
Definition: mcxt.c:655
#define ereport(elevel,...)
Definition: elog.h:157
int errmsg_internal(const char *fmt,...)
Definition: elog.c:996
#define MemoryContextIsValid(context)
Definition: memnodes.h:104
int i
int errhidecontext(bool hide_ctx)
Definition: elog.c:1269
MemoryContext nextchild
Definition: memnodes.h:89

◆ MemoryContextStatsPrint()

static void MemoryContextStatsPrint ( MemoryContext  context,
void *  passthru,
const char *  stats_string,
bool  print_to_stderr 
)
static

Definition at line 655 of file mcxt.c.

References AssertArg, ereport, errhidecontext(), errhidestmt(), errmsg_internal(), MemoryContextData::firstchild, fprintf, i, MemoryContextData::ident, LOG_SERVER_ONLY, MemoryContextIsValid, MemoryContextData::methods, MemoryContextData::name, name, MemoryContextData::nextchild, and pg_mbcliplen().

Referenced by MemoryContextStatsInternal().

658 {
659  int level = *(int *) passthru;
660  const char *name = context->name;
661  const char *ident = context->ident;
662  char truncated_ident[110];
663  int i;
664 
665  /*
666  * It seems preferable to label dynahash contexts with just the hash table
667  * name. Those are already unique enough, so the "dynahash" part isn't
668  * very helpful, and this way is more consistent with pre-v11 practice.
669  */
670  if (ident && strcmp(name, "dynahash") == 0)
671  {
672  name = ident;
673  ident = NULL;
674  }
675 
676  truncated_ident[0] = '\0';
677 
678  if (ident)
679  {
680  /*
681  * Some contexts may have very long identifiers (e.g., SQL queries).
682  * Arbitrarily truncate at 100 bytes, but be careful not to break
683  * multibyte characters. Also, replace ASCII control characters, such
684  * as newlines, with spaces.
685  */
686  int idlen = strlen(ident);
687  bool truncated = false;
688 
689  strcpy(truncated_ident, ": ");
690  i = strlen(truncated_ident);
691 
692  if (idlen > 100)
693  {
694  idlen = pg_mbcliplen(ident, idlen, 100);
695  truncated = true;
696  }
697 
698  while (idlen-- > 0)
699  {
700  unsigned char c = *ident++;
701 
702  if (c < ' ')
703  c = ' ';
704  truncated_ident[i++] = c;
705  }
706  truncated_ident[i] = '\0';
707 
708  if (truncated)
709  strcat(truncated_ident, "...");
710  }
711 
712  if (print_to_stderr)
713  {
714  for (i = 0; i < level; i++)
715  fprintf(stderr, " ");
716  fprintf(stderr, "%s: %s%s\n", name, stats_string, truncated_ident);
717  }
718  else
720  (errhidestmt(true),
721  errhidecontext(true),
722  errmsg_internal("level: %d; %s: %s%s",
723  level, name, stats_string, truncated_ident)));
724 }
#define LOG_SERVER_ONLY
Definition: elog.h:28
int errhidestmt(bool hide_stmt)
Definition: elog.c:1250
#define fprintf
Definition: port.h:220
int pg_mbcliplen(const char *mbstr, int len, int limit)
Definition: mbutils.c:1026
char * c
const char * ident
Definition: memnodes.h:91
#define ereport(elevel,...)
Definition: elog.h:157
int errmsg_internal(const char *fmt,...)
Definition: elog.c:996
const char * name
Definition: encode.c:515
int i
const char * name
Definition: memnodes.h:90
int errhidecontext(bool hide_ctx)
Definition: elog.c:1269

◆ MemoryContextStrdup()

◆ palloc()

void* palloc ( Size  size)

Definition at line 1062 of file mcxt.c.

Referenced by _bt_blnewpage(), _bt_bottomupdel_pass(), _bt_deadblocks(), _bt_dedup_pass(), _bt_delitems_delete_check(), _bt_delitems_update(), _bt_findsplitloc(), _bt_load(), _bt_mkscankey(), _bt_newroot(), _bt_pendingfsm_init(), _bt_preprocess_array_keys(), _bt_search(), _bt_simpledel_pass(), _bt_uppershutdown(), _intbig_alloc(), _lca(), _ltree_compress(), _ltree_picksplit(), _metaphone(), _SPI_make_plan_non_temp(), _SPI_save_plan(), AbsorbSyncRequests(), accum_sum_copy(), accumArrayResultArr(), aclexplode(), aclitemin(), aclitemout(), aclmembers(), acquire_inherited_sample_rows(), add_exact_object_address_extra(), add_gin_entry(), add_local_reloption(), add_reloption(), add_rte_to_flat_rtable(), add_to_tsvector(), add_unique_group_var(), addArc(), addArcs(), addCompiledLexeme(), AddEnumLabel(), addFkRecurseReferenced(), addItemsToLeaf(), addKey(), addKeyToQueue(), addNode(), addNorm(), addRangeClause(), addRangeTableEntryForFunction(), addRangeTableEntryForJoin(), AddRelationNewConstraints(), addWrd(), alloc_chromo(), alloc_edge_table(), alloc_pool(), allocate_reloption(), AllocateRelationDesc(), AlterPolicy(), AlterSubscription_refresh(), anybit_typmodout(), anychar_typmodout(), append_nonpartial_cost(), apply_handle_stream_commit(), apw_dump_now(), array_cat(), array_create_iterator(), array_exec_setup(), array_in(), array_map(), array_out(), array_recv(), array_replace_internal(), array_set_element(), array_typanalyze(), array_unnest(), arrayconst_startup_fn(), arrayexpr_startup_fn(), ArrayGetIntegerTypmods(), AssignTransactionId(), Async_Notify(), ATExecAddColumn(), ATExecColumnDefault(), attach_internal(), AttachPartitionEnsureIndexes(), autoinc(), be_loread(), be_tls_get_peer_serial(), begin_heap_rewrite(), begin_tup_output_tupdesc(), BeginCopyFrom(), binary_decode(), binary_encode(), binaryheap_allocate(), BipartiteMatch(), bit_and(), bit_catenate(), bit_or(), bit_out(), bit_recv(), bitfromint4(), bitfromint8(), bitnot(), bits_to_text(), bitsetbit(), bitshiftleft(), bitshiftright(), bitsubstring(), bitxor(), blbeginscan(), blbuild(), blbuildempty(), bms_copy(), boolout(), BootStrapXLOG(), bottomup_sort_and_shrink(), box_add(), box_center(), box_circle(), box_copy(), box_diagonal(), box_div(), box_in(), box_intersect(), box_mul(), box_poly(), box_recv(), box_sub(), boxes_bound_box(), bpchar(), bpchar_input(), bqarr_in(), bqarr_out(), brin_build_desc(), brin_copy_tuple(), brin_form_tuple(), brin_minmax_multi_distance_inet(), brin_minmax_multi_distance_interval(), brin_new_memtuple(), brin_page_items(), brin_revmap_data(), brinbeginscan(), brinbuild(), bringetbitmap(), brinRevmapInitialize(), bt_page_items_bytea(), bt_page_items_internal(), bt_page_print_tuples(), btbeginscan(), btbuild(), btbuildempty(), btgettuple(), btree_xlog_dedup(), btree_xlog_updates(), btreevacuumposting(), btrescan(), BufferSync(), BufFileCreateShared(), BufFileOpenShared(), build_attnums_array(), build_column_frequencies(), build_datatype(), build_distinct_groups(), build_EvalXFuncInt(), build_function_result_tupdesc_d(), build_local_reloptions(), build_merged_partition_bounds(), build_minmax_path(), build_pertrans_for_aggref(), build_regtype_array(), build_row_from_vars(), build_server_final_message(), build_server_first_message(), build_sorted_items(), build_subplan(), build_tlist_index(), build_tlist_index_other_vars(), build_tuplestore_recursively(), BuildCachedPlan(), buildNSItemFromLists(), buildNSItemFromTupleDesc(), BuildSpeculativeIndexInfo(), BuildTupleFromCStrings(), BuildTupleHashTableExt(), bytea_catenate(), bytea_string_agg_finalfn(), byteain(), byteaout(), bytearecv(), cache_lookup(), cache_store_tuple(), cached_scansel(), calc_distr(), calc_hist(), calc_hist_selectivity(), calc_word_similarity(), CatalogCacheCreateEntry(), catenate_stringinfo_string(), char_bpchar(), char_text(), charout(), check_foreign_key(), check_ident_usermap(), check_primary_key(), check_temp_tablespaces(), CheckAffix(), checkAllTheSame(), checkclass_str(), checkcondition_HL(), checkcondition_str(), CheckIndexCompatible(), CheckSCRAMAuth(), checkSharedDependencies(), choose_bitmap_and(), chr(), cidout(), circle_add_pt(), circle_box(), circle_center(), circle_div_pt(), circle_in(), circle_mul_pt(), circle_recv(), circle_sub_pt(), classify_index_clause_usage(), clauselist_apply_dependencies(), cleanup_tsquery_stopwords(), clone_parse_state(), close_ls(), close_lseg(), close_pb(), close_pl(), close_ps(), close_sb(), close_sl(), collect_corrupt_items(), collectTSQueryValues(), combo_encrypt(), compileTheLexeme(), compileTheSubstitute(), CompleteCachedPlan(), complex_add(), complex_in(), complex_recv(), compute_array_stats(), compute_distinct_stats(), compute_expr_stats(), compute_index_stats(), compute_range_stats(), compute_scalar_stats(), compute_tsvector_stats(), ComputeIndexAttrs(), computeLeafRecompressWALData(), concat_text(), connect_pg_server(), consider_groupingsets_paths(), construct_point(), convert_prep_stmt_params(), convert_requires_to_datum(), convert_string_datum(), convert_tuples_by_name(), convert_tuples_by_position(), copy_file(), copy_pathtarget(), copy_plpgsql_datums(), CopyCachedPlan(), CopyErrorData(), CopyIndexAttOptions(), CopyIndexTuple(), copyJsonbValue(), CopyMultiInsertBufferInit(), CopyOverrideSearchPath(), copyTemplateDependencies(), copytext(), CopyTriggerDesc(), copyTSLexeme(), copyVar(), CopyVar(), count_usable_fds(), cr_circle(), create_hash_bounds(), create_internal(), create_limit_plan(), create_list_bounds(), create_mergejoin_plan(), create_range_bounds(), create_resultcache_plan(), create_secmsg(), create_unique_plan(), create_windowagg_plan(), CreateConstraintEntry(), CreateCopyDestReceiver(), CreateFunction(), CreatePartitionDirectory(), createPostingTree(), CreateQueryDesc(), CreateTemplateTupleDesc(), CreateTrigger(), CreateTupleDescCopyConstr(), cstring_to_text_with_len(), cube_recv(), current_database(), current_schemas(), currtid_internal(), dataBeginPlaceToPageLeaf(), dataPrepareDownlink(), datetime_to_char_body(), datumCopy(), datumRestore(), datumSerialize(), dblink_get_pkey(), debackslash(), decodePageSplitRecord(), deconstruct_array(), DefineIndex(), DefineRelation(), deparse_lquery(), deparse_ltree(), dependencies_clauselist_selectivity(), dependency_degree(), DependencyGenerator_init(), deserialize_deflist(), detoast_attr(), detoast_attr_slice(), detoast_external_attr(), dibuild(), disassembleLeaf(), DiscreteKnapsack(), distribute_qual_to_rels(), do_analyze_rel(), do_compile(), do_pg_start_backup(), do_pg_stop_backup(), do_to_timestamp(), dobyteatrim(), DoCopyTo(), doPickSplit(), dotrim(), double_to_shortest_decimal(), downcase_convert(), downcase_identifier(), DropRelationFiles(), DropRelFileNodesAllBuffers(), dshash_attach(), dshash_create(), dsynonym_init(), dumpFunc(), duplicate_numeric(), dxsyn_lexize(), encrypt_password(), entry_dealloc(), entryPrepareDownlink(), enum_range_internal(), EnumValuesCreate(), EventTriggerAlterTableStart(), EventTriggerCollectAlterOpFam(), EventTriggerCollectAlterTableSubcmd(), EventTriggerCollectAlterTSConfig(), EventTriggerCollectGrant(), EventTriggerCollectSimpleCommand(), examine_attribute(), examine_expression(), exec_bind_message(), ExecAggRetrieveInstrumentation(), ExecComputeStoredGenerated(), ExecCreatePartitionPruneState(), ExecEvalArrayExpr(), ExecEvalHashedScalarArrayOp(), ExecGather(), ExecGatherMerge(), ExecHashJoinGetSavedTuple(), ExecHashRetrieveInstrumentation(), ExecHashTableCreate(), ExecIncrementalSortRetrieveInstrumentation(), ExecIndexBuildScanKeys(), ExecInitAgg(), ExecInitAppend(), ExecInitCoerceToDomain(), ExecInitExprRec(), ExecInitFunctionScan(), ExecInitIndexScan(), ExecInitJunkFilter(), ExecInitMergeAppend(), ExecInitModifyTable(), ExecInitPartitionDispatchInfo(), ExecInitProjectSet(), ExecInitResultCache(), ExecInitRoutingInfo(), ExecInitSubPlan(), ExecInitTableFuncScan(), ExecInitValuesScan(), ExecInsert(), ExecMakeTableFunctionResult(), ExecOpenIndices(), ExecParallelCreateReaders(), ExecParallelRetrieveInstrumentation(), ExecParallelSetupTupleQueues(), ExecRelCheck(), ExecResultCacheRetrieveInstrumentation(), ExecSortRetrieveInstrumentation(), execTuplesHashPrepare(), execTuplesMatchPrepare(), executeBinaryArithmExpr(), executeDateTimeMethod(), executeItemOptUnwrapTarget(), executeNumericItemMethod(), ExecuteTruncateGuts(), ExplainCreateWorkersState(), ExportSnapshot(), ExprEvalPushStep(), extract_autovac_opts(), extract_grouping_collations(), extract_grouping_cols(), extract_grouping_ops(), extract_rollup_sets(), extract_token(), fallbackSplit(), file_acquire_sample_rows(), fileBeginForeignScan(), fileGetForeignRelSize(), filter_list_to_array(), find_appinfos_by_relids(), find_hash_columns(), find_in_dynamic_libpath(), find_inheritance_children(), find_partition_scheme(), find_plan(), find_window_functions(), findDependentObjects(), findJsonbValueFromContainer(), fix_merged_indexes(), flagInhTables(), float4_to_char(), float4out(), float8_to_char(), Float8GetDatum(), float8out_internal(), float_to_shortest_decimal(), FlushRelationsAllBuffers(), format_operator_extended(), format_procedure_extended(), formTextDatum(), FreezeMultiXactId(), FuncnameGetCandidates(), g_cube_decompress(), g_cube_picksplit(), g_int_compress(), g_int_decompress(), g_int_picksplit(), g_intbig_compress(), g_intbig_picksplit(), gbt_bit_xfrm(), gbt_cash_union(), gbt_date_union(), gbt_enum_union(), gbt_float4_union(), gbt_float8_union(), gbt_inet_compress(), gbt_inet_union(), gbt_int2_union(), gbt_int4_union(), gbt_int8_union(), gbt_intv_compress(), gbt_intv_decompress(), gbt_intv_union(), gbt_num_compress(), gbt_num_fetch(), gbt_num_picksplit(), gbt_oid_union(), gbt_time_union(), gbt_timetz_compress(), gbt_ts_union(), gbt_tstz_compress(), gbt_uuid_compress(), gbt_uuid_union(), gbt_var_compress(), gbt_var_decompress(), gbt_var_fetch(), gbt_var_key_from_datum(), gbt_var_picksplit(), gen_random_uuid(), generate_append_tlist(), generate_matching_part_pairs(), generate_normalized_query(), generate_series_step_int4(), generate_series_step_int8(), generate_series_step_numeric(), generate_series_timestamp(), generate_series_timestamptz(), generate_subscripts(), generate_trgm(), generate_trgm_only(), generate_wildcard_trgm(), generateHeadline(), generator_init(), genericPickSplit(), GenericXLogStart(), get_attribute_options(), get_collation_version_for_oid(), get_configdata(), get_controlfile(), get_database_list(), get_docrep(), get_explain_guc_options(), get_ext_ver_info(), get_extension_aux_control_filename(), get_extension_control_directory(), get_extension_control_filename(), get_extension_script_directory(), get_extension_script_filename(), get_func_arg_info(), get_func_input_arg_names(), get_func_signature(), get_func_trftypes(), get_op_btree_interpretation(), get_page_from_raw(), get_path_all(), get_pkey_attnames(), get_raw_page_internal(), get_relation_info(), get_rels_with_domain(), get_str_from_var(), get_str_from_var_sci(), get_tables_to_cluster(), get_text_array_contents(), get_tsearch_config_filename(), get_val(), get_worker(), GetBlockerStatusData(), GetBulkInsertState(), GetCachedExpression(), getColorInfo(), GetCurrentVirtualXIDs(), GetFdwRoutineForRelation(), GetForeignDataWrapperExtended(), GetForeignServerExtended(), GetForeignTable(), getIthJsonbValueFromContainer(), getKeyJsonValueFromContainer(), GetLockStatusData(), GetMultiXactIdMembers(), GetOldSnapshotTimeMapping(), GetPermutation(), GetPredicateLockStatusData(), GetPreparedTransactionList(), GetPublication(), getQuadrantArea(), getRangeBox(), GetRelationPublicationActions(), GetRunningTransactionLocks(), GetSQLCurrentTime(), GetSubscription(), GetSubscriptionNotReadyRelations(), GetSubscriptionRelations(), gettoken_tsvector(), getTokenTypes(), GetUserMapping(), GetVirtualXIDsDelayingChkpt(), ghstore_alloc(), ghstore_compress(), ghstore_picksplit(), gimme_tree(), gin_bool_consistent(), gin_btree_extract_query(), gin_btree_extract_value(), gin_extract_hstore(), gin_extract_hstore_query(), gin_extract_jsonb_path(), gin_extract_jsonb_query(), gin_extract_query_trgm(), gin_extract_tsquery(), gin_extract_tsvector(), gin_extract_value_trgm(), gin_leafpage_items(), gin_trgm_triconsistent(), ginAllocEntryAccumulator(), ginbeginscan(), ginbuild(), ginCompressPostingList(), GinDataLeafPageGetItems(), ginExtractEntries(), ginFillScanEntry(), ginFillScanKey(), ginFindLeafPage(), ginFindParents(), GinFormInteriorTuple(), ginHeapTupleFastCollect(), ginHeapTupleFastInsert(), gininsert(), ginInsertBAEntry(), ginint4_queryextract(), ginMergeItemPointers(), ginPostingListDecodeAllSegments(), ginReadTuple(), ginRedoRecompress(), ginVacuumItemPointers(), ginVacuumPostingTreeLeaf(), gist_box_picksplit(), gist_box_union(), gist_circle_compress(), gist_indexsortbuild(), gist_indexsortbuild_pagestate_flush(), gist_page_items_bytea(), gist_point_compress(), gist_point_fetch(), gist_poly_compress(), gistbeginscan(), gistbufferinginserttuples(), gistbuild(), gistextractpage(), gistfillitupvec(), gistfixsplit(), gistGetItupFromPage(), gistgettuple(), gistInitBuildBuffers(), gistMakeUnionItVec(), gistplacetopage(), gistRelocateBuildBuffersOnSplit(), gistrescan(), gistScanPage(), gistSplit(), gistSplitByKey(), gistSplitHalf(), gistunionsubkeyvec(), gseg_picksplit(), gtrgm_alloc(), gtrgm_compress(), gtrgm_consistent(), gtrgm_decompress(), gtrgm_picksplit(), gtsquery_compress(), gtsquery_picksplit(), gtsvector_alloc(), gtsvector_compress(), gtsvector_decompress(), gtsvector_penalty(), gtsvector_picksplit(), gtsvectorout(), hash_agg_enter_spill_mode(), hash_object_field_end(), hash_page_items(), hash_record(), hash_record_extended(), hashagg_batch_read(), hashagg_tapeinfo_init(), hashbeginscan(), hashbpchar(), hashbpcharextended(), hashbuild(), hashgettuple(), hashtext(), hashtextextended(), heap_beginscan(), heap_copy_minimal_tuple(), heap_copy_tuple_as_datum(), heap_copytuple(), heap_copytuple_with_tuple(), heap_modify_tuple(), heap_modify_tuple_by_cols(), heap_multi_insert(), heap_page_items(), heap_tuple_from_minimal_tuple(), heap_vacuum_rel(), heapam_relation_copy_for_cluster(), hladdword(), hmac_finish(), hstore_akeys(), hstore_avals(), hstore_concat(), hstore_delete(), hstore_delete_array(), hstore_delete_hstore(), hstore_from_array(), hstore_from_arrays(), hstore_from_record(), hstore_out(), hstore_populate_record(), hstore_recv(), hstore_slice_to_array(), hstore_slice_to_hstore(), hstore_subscript_assign(), hstore_to_array_internal(), hstoreArrayToPairs(), hstorePairs(), identify_opfamily_groups(), ImportSnapshot(), index_compute_xid_horizon_for_tuples(), index_register(), index_truncate_tuple(), inet_gist_compress(), inet_gist_fetch(), inet_gist_picksplit(), inet_set_masklen(), inet_spg_inner_consistent(), inet_spg_picksplit(), infix(), init_execution_state(), init_gin_entries(), init_partition_map(), init_sexpr(), init_slab_allocator(), init_tour(), init_tsvector_parser(), InitCatCache(), InitDeadLockChecking(), initGISTstate(), initialize_brin_buildstate(), initialize_worker_spi(), initKeyArray(), InitPlan(), initRectBox(), initStringInfo(), InsertPgAttributeTuples(), int2out(), int2vectorout(), int44in(), int44out(), int4_to_char(), int4out(), Int64GetDatum(), int8_to_char(), int8out(), int_to_roman(), interpret_AS_clause(), interpret_function_parameter_list(), interval_div(), interval_in(), interval_justify_days(), interval_justify_hours(), interval_justify_interval(), interval_mi(), interval_mul(), interval_pl(), interval_recv(), interval_scale(), interval_trunc(), interval_um(), intervaltypmodout(), intset_create(), irbt_alloc(), iterate_word_similarity(), json_agg_transfn(), json_manifest_finalize_file(), json_object_agg_transfn(), json_object_keys(), jsonb_agg_transfn(), jsonb_object_agg_transfn(), jsonb_object_keys(), jsonb_ops__add_path_item(), JsonbDeepContains(), JsonbValueToJsonb(), JsonEncodeDateTime(), JumbleQuery(), lazy_space_alloc(), lca(), leafRepackItems(), leftmostvalue_interval(), leftmostvalue_timetz(), LexizeAddLemm(), libpqrcv_readtimelinehistoryfile(), like_fixed_prefix(), limit_printout_length(), line_construct_pp(), line_in(), line_interpt(), line_recv(), llvm_compile_expr(), llvm_copy_attributes_at_index(), lo_get_fragment_internal(), load_categories_hash(), load_domaintype_info(), load_enum_cache_data(), load_relcache_init_file(), load_tzoffsets(), LocalProcessControlFile(), LockBufferForCleanup(), logfile_getname(), logical_heap_rewrite_flush_mappings(), logicalrep_partition_open(), logicalrep_read_attrs(), logicalrep_read_rel(), logicalrep_read_tuple(), logicalrep_relmap_update(), LogicalRepSyncTableStart(), LogicalTapeFreeze(), LogicalTapeSetCreate(), LogicalTapeWrite(), lookup_var_attr_stats(), lowerstr_with_len(), lpad(), lseg_center(), lseg_construct(), lseg_in(), lseg_interpt(), lseg_recv(), ltree2text(), ltree_compress(), ltree_decompress(), ltree_gist_alloc(), ltree_picksplit(), ltsGetPreallocBlock(), ltsInitReadBuffer(), ltxtq_out(), ltxtq_send(), lz4_compress_datum(), lz4_decompress_datum(), lz4_decompress_datum_slice(), macaddr8_out(), macaddr_and(), macaddr_in(), macaddr_not(), macaddr_or(), macaddr_out(), macaddr_recv(), macaddr_sortsupport(), macaddr_trunc(), make_build_data(), make_callstmt_target(), make_colname_unique(), make_greater_string(), make_hba_token(), make_interval(), make_jsp_entry_node(), make_jsp_expr_node(), make_partitionedrel_pruneinfo(), make_pathtarget_from_tlist(), make_positional_trgm(), make_recursive_union(), make_result_opt_error(), make_row_comparison_op(), make_setop(), make_sort_from_groupcols(), make_sort_from_sortclauses(), make_text_key(), make_tuple_from_result_row(), make_tuple_indirect(), make_unique_from_pathkeys(), make_unique_from_sortclauses(), makeaclitem(), makeBufFile(), makeBufFileCommon(), MakeConfigurationMapping(), makeitem(), makeObjectName(), makeParamList(), makepoint(), MakeSharedInvalidMessagesArray(), makeStringInfo(), MakeTidOpExpr(), maketree(), map_variable_attnos_mutator(), mark_hl_fragments(), match_clause_to_partition_key(), MatchNamedCall(), MatchText(), materializeResult(), mbuf_create(), mbuf_create_from_data(), mcelem_array_contained_selec(), mcelem_tsquery_selec(), mcv_get_match_bitmap(), mdunlinkfork(), MergeAttributes(), minimal_tuple_from_heap_tuple(), mock_scram_secret(), moveLeafs(), mp_int_alloc(), mp_px_rand(), multirange_deserialize(), multirange_gist_compress(), multirange_in(), multirange_recv(), MultiXactIdExpand(), mXactCacheGetById(), ndistinct_for_combination(), network_sortsupport(), new_list(), new_object_addresses(), newLexeme(), newTParserPosition(), nextRectBox(), NIAddAffix(), NISortAffixes(), nodeRead(), normal_rand(), NormalizeSubWord(), NUM_cache(), numeric_sortsupport(), numeric_to_char(), numeric_to_number(), numerictypmodout(), offset_to_interval(), oidout(), oidvectorout(), oidvectortypes(), OpernameGetCandidates(), optionListToArray(), order_qual_clauses(), ordered_set_startup(), packArcInfoCmp(), packGraph(), pad_eme_pkcs1_v15(), PageGetTempPage(), PageGetTempPageCopy(), PageGetTempPageCopySpecial(), pairingheap_allocate(), palloc_btree_page(), parse_datetime(), parse_fcall_arguments(), parse_fixed_parameters(), parse_hstore(), parse_ident_line(), parse_key_value_arrays(), parse_ltree(), parse_one_reloption(), parse_scalar(), parse_scram_secret(), parse_tsquery(), parse_variable_parameters(), parseLocalRelOptions(), parseRelOptions(), partition_bounds_copy(), partition_bounds_create(), path_add(), path_in(), path_poly(), path_recv(), percentile_cont_multi_final_common(), percentile_disc_multi_final(), perform_pruning_base_step(), PerformRadiusTransaction(), pg_armor(), pg_blocking_pids(), pg_buffercache_pages(), pg_collation_actual_version(), pg_convert(), pg_current_snapshot(), pg_dearmor(), pg_decrypt(), pg_decrypt_iv(), pg_detoast_datum_copy(), pg_digest(), pg_encrypt(), pg_encrypt_iv(), pg_get_catalog_foreign_keys(), pg_get_constraintdef_worker(), pg_get_multixact_members(), pg_get_userbyid(), pg_hmac(), pg_import_system_collations(), pg_lock_status(), pg_prepared_xact(), pg_random_bytes(), pg_safe_snapshot_blocking_pids(), pg_snapshot_recv(), pg_timezone_abbrevs(), pg_timezone_names(), pgfnames(), pglz_compress_datum(), pglz_decompress_datum(), pglz_decompress_datum_slice(), pgp_armor_headers(), pgp_create_pkt_reader(), pgp_extract_armor_headers(), pgp_key_id_w(), pgp_mpi_alloc(), pgrowlocks(), pgss_shmem_startup(), pkt_stream_init(), placeChar(), plaintree(), plperl_build_tuple_result(), plperl_ref_from_pg_array(), plperl_spi_exec_prepared(), plperl_spi_prepare(), plperl_spi_query_prepared(), plperl_to_hstore(), plpgsql_add_initdatums(), plpgsql_finish_datums(), plpgsql_fulfill_promise(), plpgsql_ns_additem(), plpgsql_parse_err_condition(), plpython_to_hstore(), pltcl_quote(), pltcl_SPI_execute_plan(), pltcl_SPI_prepare(), PLy_cursor_plan(), PLy_procedure_munge_source(), PLy_spi_execute_plan(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLyObject_ToBytea(), PLyObject_ToJsonbValue(), PLySequence_ToArray(), PLySequence_ToComposite(), pnstrdup(), point_add(), point_box(), point_div(), point_in(), point_mul(), point_recv(), point_sub(), points_box(), policy_role_list_to_array(), poly_box(), poly_center(), poly_circle(), poly_path(), populate_array(), populate_array_assign_ndims(), populate_record(), populate_recordset_object_field_end(), populate_scalar(), populate_typ_list(), PostgresMain(), pq_getmsgtext(), prepare_sort_from_pathkeys(), prepare_sql_fn_parse_info(), preparePresortedCols(), PrepareQuery(), preprocess_aggref(), preprocess_grouping_sets(), PrescanPreparedTransactions(), ProcArrayApplyRecoveryInfo(), process_pipe_input(), process_startup_options(), process_syncing_tables_for_apply(), ProcessStartupPacket(), prs_setup_firstcall(), prsd_lextype(), psprintf(), publicationListToArray(), pull_up_sublinks_jointree_recurse(), pullf_create(), pushf_create(), pushJsonbValueScalar(), PushOverrideSearchPath(), pushquery(), pushState(), pushval_morph(), px_find_cipher(), px_find_digest(), px_find_hmac(), QTNCopy(), queryin(), queue_listen(), quote_identifier(), quote_literal(), quote_literal_cstr(), range_deserialize(), range_gist_double_sorting_split(), range_gist_picksplit(), range_gist_single_sorting_split(), rbt_create(), RE_compile(), RE_compile_and_cache(), RE_execute(), read_binary_file(), read_client_final_message(), read_dictionary(), read_extension_aux_control_file(), read_whole_file(), readAttrNumberCols(), readBoolCols(), readDatum(), readIntCols(), readOidCols(), readstoplist(), readTimeLineHistory(), readtup_heap(), ReadTwoPhaseFile(), rebuild_database_list(), record_cmp(), record_eq(), record_image_cmp(), record_image_eq(), record_in(), record_manifest_details_for_wal_range(), record_out(), record_recv(), record_send(), recordMultipleDependencies(), reduce_expanded_ranges(), reduce_outer_joins_pass1(), regclassout(), regcollationout(), regconfigout(), regdictionaryout(), regexp_fixed_prefix(), regexp_match(), regexp_matches(), register_label_provider(), register_on_commit_action(), RegisterDynamicBackgroundWorker(), regnamespaceout(), regoperout(), regprocout(), regroleout(), regtypeout(), ReindexRelationConcurrently(), RelationBuildPartitionDesc(), RelationBuildTriggers(), RelationGetExclusionInfo(), RelationGetIndexScan(), RememberSyncRequest(), RememberToFreeTupleDescAtEOX(), remove_dbtablespaces(), RemoveRoleFromObjectPolicy(), ReorderBufferAddInvalidations(), ReorderBufferQueueMessage(), reorderqueue_push(), repeat(), replace_auto_config_value(), replace_text_regexp(), report_json_context(), report_untranslatable_char(), ResolveRecoveryConflictWithVirtualXIDs(), RewriteQuery(), rpad(), s_alloc(), save_state_data(), scanPendingInsert(), scram_build_secret(), scram_verify_plain_password(), SearchCatCacheList(), searchRangeTableForCol(), seg_in(), seg_inter(), seg_out(), seg_union(), select_active_windows(), select_outer_pathkeys_for_merge(), selectColorTrigrams(), sepgsql_fmgr_hook(), seq_redo(), serialize_expr_stats(), SerializeTransactionState(), set_baserel_partition_key_exprs(), set_plan_references(), set_relation_column_names(), set_rtable_names(), set_var_from_str(), setup_firstcall(), setup_pct_info(), setup_regexp_matches(), setup_test_matches(), shm_mq_attach(), show_trgm(), SignalBackends(), similar_escape_internal(), slot_compile_deform(), slot_fill_defaults(), smgrDoPendingDeletes(), smgrDoPendingSyncs(), smgrdounlinkall(), smgrGetPendingDeletes(), SnapBuildInitialSnapshot(), SortAndUniqItems(), spg_box_quad_inner_consistent(), spg_box_quad_picksplit(), spg_kd_inner_consistent(), spg_kd_picksplit(), spg_key_orderbys_distances(), spg_poly_quad_compress(), spg_quad_inner_consistent(), spg_quad_picksplit(), spg_range_quad_inner_consistent(), spg_range_quad_picksplit(), spg_text_choose(), spg_text_inner_consistent(), spg_text_leaf_consistent(), spg_text_picksplit(), spgAddPendingTID(), spgAllocSearchItem(), spgbeginscan(), spgbuildempty(), spgExtractNodeLabels(), spgInnerTest(), spgist_name_choose(), spgist_name_inner_consistent(), spgNewHeapItem(), spgRedoVacuumRedirect(), spgSplitNodeAction(), spi_dest_startup(), SPI_modifytuple(), SPI_register_trigger_data(), split_pathtarget_walker(), SplitToVariants(), ssl_extension_info(), StandbyAcquireAccessExclusiveLock(), StartPrepare(), startScanKey(), StartupXLOG(), statext_mcv_build(), statext_mcv_clauselist_selectivity(), statext_mcv_deserialize(), statext_ndistinct_build(), statext_ndistinct_deserialize(), statext_ndistinct_serialize(), std_typanalyze(), store_flush_position(), storeGettuple(), StoreRelCheck(), storeRow(), str_initcap(), str_numth(), str_tolower(), str_toupper(), str_udeescape(), stream_open_file(), string_to_bytea_const(), strlist_to_textarray(), subxact_info_add(), subxact_info_read(), subxact_info_write(), SV_to_JsonbValue(), SyncRepGetCandidateStandbys(), SyncRepGetNthLatestSyncRecPtr(), SyncRepWaitForLSN(), systable_beginscan(), systable_beginscan_ordered(), table_recheck_autovac(), tablesample_init(), tbm_begin_iterate(), test_enc_conversion(), test_pattern(), test_re_compile(), test_regex(), test_single_value_and_filler(), testdelete(), testprs_lextype(), text_catenate(), text_reverse(), text_substring(), text_to_bits(), text_to_cstring(), thesaurus_lexize(), tidin(), TidListEval(), tidrecv(), time_interval(), time_mi_time(), time_timetz(), timestamp_age(), timestamp_mi(), timestamptz_age(), timestamptz_timetz(), timetz_in(), timetz_izone(), timetz_mi_interval(), timetz_pl_interval(), timetz_recv(), timetz_scale(), timetz_zone(), to_tsvector_byid(), toast_fetch_datum(), toast_fetch_datum_slice(), toast_open_indexes(), toast_save_datum(), tokenize_file(), tokenize_inc_file(), TParserInit(), transformFromClauseItem(), transformRangeTableFunc(), transformRelOptions(), translate(), ts_dist(), ts_headline_byid_opt(), ts_headline_json_byid_opt(), ts_headline_jsonb_byid_opt(), ts_lexize(), TS_phrase_output(), ts_process_call(), tsqueryout(), tsqueryrecv(), tsquerytree(), tstz_dist(), tsvector_setweight(), tsvector_setweight_by_filter(), tsvector_to_array(), tsvector_unnest(), tsvector_update_trigger(), tsvectorin(), tsvectorout(), tt_setup_firstcall(), ttdummy(), tuple_data_split_internal(), TupleDescGetAttInMetadata(), tuplesort_begin_batch(), tuplestore_begin_common(), typenameTypeMod(), unicode_is_normalized(), unicode_normalize_func(), uniqueWORD(), update_attstats(), UpdateLogicalMappings(), uuid_in(), uuid_recv(), uuid_sortsupport(), vac_open_indexes(), validate_pkattnums(), varbit(), varbit_out(), varbit_recv(), variable_paramref_hook(), varstr_abbrev_convert(), varstr_cmp(), varstr_levenshtein(), varstr_sortsupport(), WaitOnLock(), widget_in(), xid8out(), xidout(), XLogInsertRecord(), XLogReadRecordAlloc(), XlogReadTwoPhaseData(), xml_is_document(), xml_recv(), xpath_string(), xpath_table(), and xslt_process().

1063 {
1064  /* duplicates MemoryContextAlloc to avoid increased overhead */
1065  void *ret;
1067 
1068  AssertArg(MemoryContextIsValid(context));
1069  AssertNotInCriticalSection(context);
1070 
1071  if (!AllocSizeIsValid(size))
1072  elog(ERROR, "invalid memory alloc request size %zu", size);
1073 
1074  context->isReset = false;
1075 
1076  ret = context->methods->alloc(context, size);
1077  if (unlikely(ret == NULL))
1078  {
1080  ereport(ERROR,
1081  (errcode(ERRCODE_OUT_OF_MEMORY),
1082  errmsg("out of memory"),
1083  errdetail("Failed on request of size %zu in memory context \"%s\".",
1084  size, context->name)));
1085  }
1086 
1087  VALGRIND_MEMPOOL_ALLOC(context, ret, size);
1088 
1089  return ret;
1090 }
const MemoryContextMethods * methods
Definition: memnodes.h:85
int errcode(int sqlerrcode)
Definition: elog.c:698
#define AssertNotInCriticalSection(context)
Definition: mcxt.c:73
#define ERROR
Definition: elog.h:46
void MemoryContextStats(MemoryContext context)
Definition: mcxt.c:505
int errdetail(const char *fmt,...)
Definition: elog.c:1042
MemoryContext CurrentMemoryContext
Definition: mcxt.c:42
void *(* alloc)(MemoryContext context, Size size)
Definition: memnodes.h:60
#define AssertArg(condition)
Definition: c.h:806
MemoryContext TopMemoryContext
Definition: mcxt.c:48
#define AllocSizeIsValid(size)
Definition: memutils.h:42
#define ereport(elevel,...)
Definition: elog.h:157
#define MemoryContextIsValid(context)
Definition: memnodes.h:104
#define VALGRIND_MEMPOOL_ALLOC(context, addr, size)
Definition: memdebug.h:29
int errmsg(const char *fmt,...)
Definition: elog.c:909
#define elog(elevel,...)
Definition: elog.h:232
#define unlikely(x)
Definition: c.h:273
const char * name
Definition: memnodes.h:90

◆ palloc0()

void* palloc0 ( Size  size)

Definition at line 1093 of file mcxt.c.

Referenced by _bt_begin_parallel(), _bt_blwritepage(), _bt_buildadd(), _bt_form_posting(), _bt_leader_participate_as_worker(), _bt_load(), _bt_pagestate(), _bt_parallel_build_main(), _bt_parallel_scan_and_sort(), _bt_preprocess_array_keys(), _bt_spools_heapscan(), _bt_truncate(), _bt_update_posting(), _h_spoolinit(), _ltq_extract_regex(), _ltree_extract_isparent(), _ltree_extract_risparent(), _ltxtq_extract_exec(), _mdfd_getseg(), _SPI_make_plan_non_temp(), _SPI_save_plan(), accum_sum_rescale(), add_column_to_pathtarget(), add_dummy_return(), add_foreign_final_paths(), add_foreign_ordered_paths(), add_sp_item_to_pathtarget(), addFkRecurseReferencing(), allocacl(), AllocateRelationDesc(), allocateReloptStruct(), AllocateSnapshotBuilder(), AlterObjectNamespace_internal(), AlterObjectOwner_internal(), AlterObjectRename_internal(), AlterOpFamilyAdd(), AlterOpFamilyDrop(), array_cat(), array_create_iterator(), array_get_slice(), array_in(), array_map(), array_recv(), array_replace_internal(), array_set_element(), array_set_slice(), array_to_tsvector(), ATAddCheckConstraint(), ATExecAddColumn(), ATExecValidateConstraint(), ATGetQueueEntry(), ATPrepAlterColumnType(), begin_heap_rewrite(), begin_parallel_vacuum(), BeginCopyFrom(), BeginCopyTo(), bernoulli_initsamplescan(), bf_load(), BipartiteMatch(), bit(), bit_in(), blbulkdelete(), blgetbitmap(), bloom_create(), bloom_init(), BloomFormTuple(), blvacuumcleanup(), bms_add_range(), bms_make_singleton(), bpchar_name(), brin_bloom_opcinfo(), brin_form_placeholder_tuple(), brin_form_tuple(), brin_inclusion_opcinfo(), brin_minmax_multi_opcinfo(), brin_minmax_multi_union(), brin_minmax_opcinfo(), brin_new_memtuple(), brinbulkdelete(), bringetbitmap(), brinvacuumcleanup(), bt_check_every_level(), bt_page_print_tuples(), btbulkdelete(), btvacuumcleanup(), build_distances(), build_expanded_ranges(), build_expr_data(), build_inet_union_key(), build_pertrans_for_aggref(), build_row_from_vars(), build_simple_rel(), build_sorted_items(), BuildDescForRelation(), BuildEventTriggerCache(), buildint2vector(), buildNSItemFromLists(), buildNSItemFromTupleDesc(), buildoidvector(), calc_rank_and(), calc_rank_cd(), calc_word_similarity(), check_hba(), check_ident_usermap(), check_tuple_attribute(), cidr_set_masklen_internal(), circle_poly(), collect_corrupt_items(), collect_visibility_data(), combo_init(), compact_palloc0(), CompactCheckpointerRequestQueue(), compile_plperl_function(), compile_pltcl_function(), compute_partition_bounds(), ComputeIndexAttrs(), construct_empty_array(), construct_md_array(), copy_ltree(), CopyCachedPlan(), create_array_envelope(), create_foreign_modify(), create_groupingsets_plan(), create_hash_bounds(), create_list_bounds(), create_queryEnv(), create_range_bounds(), CreateCachedPlan(), CreateFakeRelcacheEntry(), CreateIntoRelDestReceiver(), CreateOneShotCachedPlan(), CreateParallelContext(), CreateSQLFunctionDestReceiver(), CreateTransientRelDestReceiver(), CreateTupleDescCopyConstr(), CreateTupleQueueDestReceiver(), CreateTupleQueueReader(), CreateTuplestoreDestReceiver(), crosstab(), cryptohash_internal(), cube_a_f8(), cube_a_f8_f8(), cube_c_f8(), cube_c_f8_f8(), cube_enlarge(), cube_f8(), cube_f8_f8(), cube_inter(), cube_subset(), cube_union_v0(), deconstruct_array(), DefineOpClass(), deparse_context_for(), deparse_context_for_plan_tree(), DependencyGenerator_init(), dintdict_init(), dintdict_lexize(), disassembleLeaf(), dispell_init(), div_var(), div_var_fast(), do_analyze_rel(), doPickSplit(), dsimple_init(), dsimple_lexize(), dsm_impl_mmap(), dsnowball_init(), dsnowball_lexize(), dsynonym_init(), dsynonym_lexize(), dxsyn_init(), each_worker(), elements_worker(), encrypt_init(), end_parallel_vacuum(), eqjoinsel_inner(), eqjoinsel_semi(), EvalPlanQualInit(), EvalPlanQualStart(), EventTriggerCollectAlterDefPrivs(), EventTriggerCollectAlterTSConfig(), EventTriggerCollectCreateOpClass(), EventTriggerSQLDropAddObject(), examine_attribute(), examine_expression(), exec_bind_message(), ExecBuildAuxRowMark(), ExecBuildGroupingEqual(), ExecBuildParamSetEqual(), ExecFindInitialMatchingSubPlans(), ExecGrant_Relation(), ExecHashIncreaseNumBatches(), ExecHashTableCreate(), ExecHashTableReset(), ExecIndexBuildScanKeys(), ExecInitAgg(), ExecInitAppend(), ExecInitBitmapAnd(), ExecInitBitmapOr(), ExecInitExprRec(), ExecInitFunc(), ExecInitGatherMerge(), ExecInitIndexScan(), ExecInitJunkFilterConversion(), ExecInitMergeAppend(), ExecInitParallelPlan(), ExecInitPruningContext(), ExecInitRangeTable(), ExecInitResultRelation(), ExecInitSetOp(), ExecInitSubscriptingRef(), ExecInitValuesScan(), ExecInitWindowAgg(), ExecParallelHashEnsureBatchAccessors(), ExecParallelHashJoinSetUpBatches(), ExecParallelHashRepartitionRest(), ExecReScanHashJoin(), ExecSetupPartitionTupleRouting(), ExecShutdownHash(), expand_colnames_array_to(), expand_partitioned_rtentry(), expand_planner_arrays(), expand_tuple(), ExplainCreateWorkersState(), extract_jsp_query(), extract_rollup_sets(), extract_variadic_args(), fetch_more_data(), fetch_remote_table_info(), fetch_statentries_for_relation(), fillFakeState(), find_partition_scheme(), find_window_functions(), findeq(), formrdesc(), g_intbig_consistent(), gather_merge_setup(), gbt_macad8_union(), gbt_macad_union(), gbt_num_bin_union(), gbt_num_compress(), gbt_var_key_copy(), gbt_var_node_truncate(), generate_base_implied_equalities_no_const(), generate_combinations(), generate_dependencies(), get_crosstab_tuplestore(), get_json_object_as_hash(), get_matching_hash_bounds(), get_matching_list_bounds(), get_matching_partitions(), get_matching_range_bounds(), get_relation_info(), get_subscription_list(), get_worker(), GetAccessStrategy(), GetAfterTriggersTableData(), getColorInfo(), GetLockConflicts(), GetOverrideSearchPath(), GetRelationPublicationActions(), gin_extract_tsquery(), ginbulkdelete(), ginExtractEntries(), ginFillScanKey(), ginScanToDelete(), ginvacuumcleanup(), gist_box_picksplit(), gist_indexsortbuild(), gistbeginscan(), gistbulkdelete(), gistdoinsert(), gistFindPath(), gistUserPicksplit(), gistvacuumcleanup(), hashagg_batch_new(), hashagg_spill_init(), hashbulkdelete(), heap_form_minimal_tuple(), heap_form_tuple(), heap_toast_insert_or_update(), heap_tuple_infomask_flags(), heap_vacuum_rel(), heapam_index_fetch_begin(), hmac_init(), identify_join_columns(), index_form_tuple(), inet_gist_compress(), inet_gist_fetch(), inetand(), inetnot(), inetor(), init_returning_filter(), init_sql_fcache(), InitCatCache(), initHyperLogLog(), InitializeParallelDSM(), InitPlan(), InitResultRelInfo(), initSpGistState(), inittapestate(), inline_function(), inner_subltree(), InstrAlloc(), int2vectorin(), internal_inetpl(), interpret_AS_clause(), interpret_function_parameter_list(), iterate_json_values(), iteratorFromContainer(), join_tsqueries(), json_array_length(), json_object_keys(), json_strip_nulls(), jsonb_agg_transfn(), jsonb_exec_setup(), jsonb_object_agg_transfn(), jsonb_set_element(), LaunchParallelWorkers(), lazy_scan_heap(), lca_inner(), leftmostvalue_macaddr(), leftmostvalue_macaddr8(), leftmostvalue_name(), leftmostvalue_uuid(), libpqrcv_connect(), libpqrcv_exec(), llvm_compile_expr(), llvm_resolve_symbol(), load_relcache_init_file(), logicalrep_read_tuple(), ltree_concat(), ltree_picksplit(), ltree_union(), macaddr8_and(), macaddr8_in(), macaddr8_not(), macaddr8_or(), macaddr8_recv(), macaddr8_set7bit(), macaddr8_trunc(), macaddr8tomacaddr(), macaddrtomacaddr8(), make_attrmap(), make_callstmt_target(), make_inh_translation_list(), make_multirange(), make_one_partition_rbound(), make_parsestate(), make_partition_pruneinfo(), make_partitionedrel_pruneinfo(), make_setop_translation_list(), make_sort_input_target(), make_tsvector(), make_tuple_from_result_row(), make_tuple_indirect(), makeArrayResultArr(), makeDefaultBloomOptions(), makeJsonLexContextCstringLen(), makeNumericAggState(), makeNumericAggStateCurrentContext(), MakeTransitionCaptureState(), MakeTupleTableSlot(), mcv_clause_selectivity_or(), mdcbuf_init(), minmax_multi_init(), MJExamineQuals(), mkVoidAffix(), mul_var(), multi_sort_init(), multirange_constructor2(), multirange_get_range(), multirange_intersect_internal(), multirange_minus_internal(), multirange_union(), nameconcatoid(), namein(), namerecv(), ndistinct_for_combination(), network_broadcast(), network_hostmask(), network_in(), network_netmask(), network_network(), network_recv(), new_intArrayType(), NewExplainState(), newRegisNode(), NIImportOOAffixes(), NISortDictionary(), numeric_accum_inv(), oidvectorin(), ordered_set_startup(), parallel_vacuum_main(), ParallelSlotsSetup(), parse_hba_line(), parse_ident_line(), parse_lquery(), parse_ltree(), parse_tsquery(), perform_base_backup(), perform_pruning_combine_step(), pg_be_scram_init(), pg_crypt(), pg_decode_startup(), pg_logical_slot_get_changes_guts(), pg_stat_get_wal_receiver(), pg_tzenumerate_start(), pgoutput_startup(), pgoutput_truncate(), pgp_cfb_create(), pgp_init(), pgp_key_alloc(), placeChar(), plperl_build_tuple_result(), plperl_modify_tuple(), plperl_ref_from_pg_array(), plperl_spi_prepare(), plpgsql_build_recfield(), plpgsql_build_record(), plpgsql_build_variable(), plpgsql_compile_inline(), plsample_func_handler(), pltcl_build_tuple_result(), pltcl_SPI_prepare(), PLy_modify_tuple(), PLy_procedure_create(), PLy_spi_prepare(), poly_in(), poly_recv(), populate_array_assign_ndims(), populate_recordset_worker(), postgresBeginDirectModify(), postgresBeginForeignScan(), postgresGetForeignJoinPaths(), postgresGetForeignRelSize(), postgresGetForeignUpperPaths(), prepare_query_params(), prepare_sql_fn_parse_info(), preparePresortedCols(), preprocess_grouping_sets(), printtup_create_DR(), printtup_prepare_info(), ProcessCopyOptions(), prune_append_rel_partitions(), pull_up_constant_function(), pull_up_simple_subquery(), pull_up_simple_values(), pullf_create(), push_path(), pushf_create(), pushOperator(), pushStop(), pushValue_internal(), px_find_combo(), QT2QTN(), QTN2QT(), QTNBinary(), queryin(), range_agg_finalfn(), range_serialize(), read_extension_control_file(), read_tablespace_map(), refresh_by_match_merge(), RelationBuildLocalRelation(), RelationBuildPartitionKey(), RelationBuildTriggers(), RelationFindReplTupleSeq(), RelationGetIndexAttOptions(), RelationGetIndexRawAttOptions(), remap_groupColIdx(), remove_useless_groupby_columns(), ReorderBufferProcessTXN(), ReorderBufferToastReplace(), reverse_name(), rewriteTargetListIU(), rewriteValuesRTE(), rj_load(), save_state_data(), selectColorTrigrams(), SendBackupManifest(), sepgsql_avc_compute(), sepgsql_set_client_label(), set_append_rel_size(), set_baserel_partition_key_exprs(), set_deparse_for_query(), set_join_column_names(), set_joinrel_partition_key_exprs(), set_simple_column_names(), set_subquery_pathlist(), setup_regexp_matches(), setup_simple_rel_arrays(), setup_test_matches(), spg_quad_picksplit(), spgbeginscan(), spgbuild(), spgbulkdelete(), spgFormInnerTuple(), spgFormLeafTuple(), spgFormNodeTuple(), spgist_name_leaf_consistent(), spgvacuumcleanup(), spi_dest_startup(), standard_ExecutorStart(), standard_join_search(), StartPrepare(), StartupDecodingContext(), statext_dependencies_build(), statext_dependencies_deserialize(), statext_dependencies_serialize(), statext_mcv_build(), statext_mcv_deserialize(), statext_mcv_serialize(), statext_ndistinct_deserialize(), sts_attach(), sts_initialize(), system_initsamplescan(), system_rows_initsamplescan(), system_time_initsamplescan(), tbm_attach_shared_iterate(), test_rls_hooks_permissive(), test_rls_hooks_restrictive(), testdelete(), testprs_start(), text_name(), thesaurus_init(), TidExprListCreate(), toast_flatten_tuple_to_datum(), TParserCopyInit(), TParserInit(), transform_json_string_values(), transformFromClauseItem(), transformSetOperationStmt(), transformValuesClause(), transformWithClause(), trgm_presence_map(), ts_headline_json_byid_opt(), ts_headline_jsonb_byid_opt(), ts_setup_firstcall(), tsquery_not(), tsqueryrecv(), tsvector_concat(), tsvector_delete_arr(), tsvector_delete_by_indices(), tsvector_filter(), tsvector_strip(), tsvectorin(), tsvectorrecv(), TupleDescGetAttInMetadata(), tuplesort_begin_cluster(), tuplesort_begin_common(), tuplesort_begin_datum(), tuplesort_begin_heap(), tuplesort_begin_index_btree(), tuplesort_begin_index_gist(), tuplestore_begin_common(), unaccent_lexize(), varbit_in(), XLogPrefetcherAllocate(), and XmlTableInitOpaque().

1094 {
1095  /* duplicates MemoryContextAllocZero to avoid increased overhead */
1096  void *ret;
1098 
1099  AssertArg(MemoryContextIsValid(context));
1100  AssertNotInCriticalSection(context);
1101 
1102  if (!AllocSizeIsValid(size))
1103  elog(ERROR, "invalid memory alloc request size %zu", size);
1104 
1105  context->isReset = false;
1106 
1107  ret = context->methods->alloc(context, size);
1108  if (unlikely(ret == NULL))
1109  {
1111  ereport(ERROR,
1112  (errcode(ERRCODE_OUT_OF_MEMORY),
1113  errmsg("out of memory"),
1114  errdetail("Failed on request of size %zu in memory context \"%s\".",
1115  size, context->name)));
1116  }
1117 
1118  VALGRIND_MEMPOOL_ALLOC(context, ret, size);
1119 
1120  MemSetAligned(ret, 0, size);
1121 
1122  return ret;
1123 }
#define MemSetAligned(start, val, len)
Definition: c.h:1041
const MemoryContextMethods * methods
Definition: memnodes.h:85
int errcode(int sqlerrcode)
Definition: elog.c:698
#define AssertNotInCriticalSection(context)
Definition: mcxt.c:73
#define ERROR
Definition: elog.h:46
void MemoryContextStats(MemoryContext context)
Definition: mcxt.c:505
int errdetail(const char *fmt,...)
Definition: elog.c:1042
MemoryContext CurrentMemoryContext
Definition: mcxt.c:42
void *(* alloc)(MemoryContext context, Size size)
Definition: memnodes.h:60
#define AssertArg(condition)
Definition: c.h:806
MemoryContext TopMemoryContext
Definition: mcxt.c:48
#define AllocSizeIsValid(size)
Definition: memutils.h:42
#define ereport(elevel,...)
Definition: elog.h:157
#define MemoryContextIsValid(context)
Definition: memnodes.h:104
#define VALGRIND_MEMPOOL_ALLOC(context, addr, size)
Definition: memdebug.h:29
int errmsg(const char *fmt,...)
Definition: elog.c:909
#define elog(elevel,...)
Definition: elog.h:232
#define unlikely(x)
Definition: c.h:273
const char * name
Definition: memnodes.h:90

◆ palloc_extended()

void* palloc_extended ( Size  size,
int  flags 
)

Definition at line 1126 of file mcxt.c.

Referenced by allocate_recordbuf(), XLogReaderAllocate(), XLogReaderValidatePageHeader(), and XLogReadRecordAlloc().

1127 {
1128  /* duplicates MemoryContextAllocExtended to avoid increased overhead */
1129  void *ret;
1131 
1132  AssertArg(MemoryContextIsValid(context));
1133  AssertNotInCriticalSection(context);
1134 
1135  if (((flags & MCXT_ALLOC_HUGE) != 0 && !AllocHugeSizeIsValid(size)) ||
1136  ((flags & MCXT_ALLOC_HUGE) == 0 && !AllocSizeIsValid(size)))
1137  elog(ERROR, "invalid memory alloc request size %zu", size);
1138 
1139  context->isReset = false;
1140 
1141  ret = context->methods->alloc(context, size);
1142  if (unlikely(ret == NULL))
1143  {
1144  if ((flags & MCXT_ALLOC_NO_OOM) == 0)
1145  {
1147  ereport(ERROR,
1148  (errcode(ERRCODE_OUT_OF_MEMORY),
1149  errmsg("out of memory"),
1150  errdetail("Failed on request of size %zu in memory context \"%s\".",
1151  size, context->name)));
1152  }
1153  return NULL;
1154  }
1155 
1156  VALGRIND_MEMPOOL_ALLOC(context, ret, size);
1157 
1158  if ((flags & MCXT_ALLOC_ZERO) != 0)
1159  MemSetAligned(ret, 0, size);
1160 
1161  return ret;
1162 }
#define MemSetAligned(start, val, len)
Definition: c.h:1041
#define MCXT_ALLOC_HUGE
Definition: fe_memutils.h:16
const MemoryContextMethods * methods
Definition: memnodes.h:85
#define MCXT_ALLOC_NO_OOM
Definition: fe_memutils.h:18
int errcode(int sqlerrcode)
Definition: elog.c:698
#define AssertNotInCriticalSection(context)
Definition: mcxt.c:73
#define ERROR
Definition: elog.h:46
void MemoryContextStats(MemoryContext context)
Definition: mcxt.c:505
int errdetail(const char *fmt,...)
Definition: elog.c:1042
MemoryContext CurrentMemoryContext
Definition: mcxt.c:42
void *(* alloc)(MemoryContext context, Size size)
Definition: memnodes.h:60
#define AssertArg(condition)
Definition: c.h:806
MemoryContext TopMemoryContext
Definition: mcxt.c:48
#define AllocSizeIsValid(size)
Definition: memutils.h:42
#define ereport(elevel,...)
Definition: elog.h:157
#define MemoryContextIsValid(context)
Definition: memnodes.h:104
#define VALGRIND_MEMPOOL_ALLOC(context, addr, size)
Definition: memdebug.h:29
#define MCXT_ALLOC_ZERO
Definition: fe_memutils.h:19
#define AllocHugeSizeIsValid(size)
Definition: memutils.h:46
int errmsg(const char *fmt,...)
Definition: elog.c:909
#define elog(elevel,...)
Definition: elog.h:232
#define unlikely(x)
Definition: c.h:273
const char * name
Definition: memnodes.h:90

◆ pchomp()

char* pchomp ( const char *  in)

◆ pfree()

void pfree ( void *  pointer)

Definition at line 1169 of file mcxt.c.

Referenced by _bt_blwritepage(), _bt_bottomupdel_pass(), _bt_buildadd(), _bt_dedup_finish_pending(), _bt_dedup_pass(), _bt_delitems_delete(), _bt_delitems_delete_check(), _bt_delitems_vacuum(), _bt_doinsert(), _bt_findsplitloc(), _bt_freestack(), _bt_getroot(), _bt_gettrueroot(), _bt_insert_parent(), _bt_insertonpg(), _bt_load(), _bt_newroot(), _bt_pendingfsm_finalize(), _bt_simpledel_pass(), _bt_sort_dedup_finish_pending(), _bt_split(), _bt_spooldestroy(), _bt_truncate(), _bt_uppershutdown(), _fdvec_resize(), _h_spooldestroy(), _hash_splitbucket(), _hash_squeezebucket(), _int_contains(), _int_inter(), _int_overlap(), _int_same(), _int_union(), _lca(), _mdfd_getseg(), _mdfd_openseg(), _mdfd_segpath(), AbortBufferIO(), AbsorbSyncRequests(), accum_sum_rescale(), accumArrayResultArr(), aclmerge(), add_partial_path(), add_path(), addArcs(), AddEnumLabel(), AddFileToBackupManifest(), addFkRecurseReferenced(), addHLParsedLex(), addItemPointersToLeafTuple(), addKey(), adjust_appendrel_attrs_multilevel(), adjust_child_relids_multilevel(), advance_windowaggregate(), advance_windowaggregate_base(), afterTriggerDeleteHeadEventChunk(), AfterTriggerEndSubXact(), afterTriggerFreeEventList(), afterTriggerRestoreEventList(), agg_refill_hash_table(), allocate_recordbuf(), AlterObjectNamespace_internal(), AlterObjectOwner_internal(), AlterObjectRename_internal(), amvalidate(), appendStringInfoStringQuoted(), apply_handle_stream_commit(), apply_scanjoin_target_to_paths(), ApplyWorkerMain(), apw_dump_now(), array_free_iterator(), array_in(), array_map(), array_out(), array_recv(), array_replace_internal(), array_send(), array_set_element_expanded(), array_to_json_internal(), array_to_jsonb_internal(), array_to_text_internal(), arrayconst_cleanup_fn(), arrayexpr_cleanup_fn(), ArrayGetIntegerTypmods(), ASN1_STRING_to_text(), assign_simple_var(), AssignTransactionId(), Async_Notify(), AtEOSubXact_Inval(), AtEOSubXact_Namespace(), AtEOSubXact_on_commit_actions(), AtEOSubXact_PgStat(), AtEOXact_GUC(), AtEOXact_Namespace(), AtEOXact_on_commit_actions(), AtEOXact_RelationCache(), ATPrepAlterColumnType(), AtSubAbort_childXids(), AtSubAbort_Notify(), AtSubAbort_Snapshot(), AtSubCommit_childXids(), AtSubCommit_Notify(), AttrDefaultFetch(), auth_peer(), autoinc(), AuxiliaryProcessMain(), backend_read_statsfile(), BackendInitialize(), be_tls_close(), be_tls_open_server(), begin_parallel_vacuum(), binaryheap_free(), bind_param_error_callback(), BipartiteMatchFree(), blendscan(), blgetbitmap(), bloom_free(), blrescan(), bms_add_members(), bms_free(), bms_int_members(), bms_join(), boolop(), BootStrapXLOG(), bottomup_sort_and_shrink(), bpcharfastcmp_c(), bpcharrecv(), bqarr_in(), brin_build_desc(), brin_form_tuple(), brin_free_tuple(), brin_inclusion_add_value(), brin_inclusion_union(), brin_minmax_add_value(), brin_minmax_multi_distance_inet(), brin_minmax_multi_union(), brin_minmax_union(), brin_page_items(), brinendscan(), brinRevmapTerminate(), brinsummarize(), bt_check_level_from_leftmost(), bt_child_check(), bt_child_highkey_check(), bt_downlink_missing_check(), bt_normalize_tuple(), bt_page_print_tuples(), bt_right_page_check_scankey(), bt_rootdescend(), bt_target_page_check(), bt_tuple_present_callback(), btendscan(), btinsert(), btree_xlog_updates(), btvacuumpage(), buf_finalize(), BufferSync(), BufFileClose(), build_child_join_rel(), build_child_join_sjinfo(), build_EvalXFuncInt(), build_index_paths(), build_local_reloptions(), build_pertrans_for_aggref(), build_reloptions(), build_sorted_items(), buildFreshLeafTuple(), BuildRelationExtStatistics(), BuildRestoreCommand(), BuildTupleFromCStrings(), cache_locale_time(), cache_single_string(), calc_arraycontsel(), calc_distr(), calc_rank_and(), calc_rank_cd(), calc_rank_or(), calc_word_similarity(), cancel_on_dsm_detach(), CatalogCloseIndexes(), CatCacheFreeKeys(), CatCacheRemoveCList(), CatCacheRemoveCTup(), char2wchar(), check_circularity(), check_datestyle(), check_db_file_conflict(), check_ident_usermap(), check_locale(), check_log_destination(), check_relation_privileges(), check_schema_perms(), check_search_path(), check_temp_tablespaces(), check_timezone(), check_TSCurrentConfig(), check_wal_consistency_checking(), CheckAffix(), checkclass_str(), checkcondition_str(), CheckConstraintFetch(), CheckIndexCompatible(), CheckMD5Auth(), CheckPasswordAuth(), CheckPointTwoPhase(), CheckPWChallengeAuth(), CheckRADIUSAuth(), CheckSCRAMAuth(), checkSharedDependencies(), ChooseConstraintName(), ChooseExtendedStatisticName(), ChooseRelationName(), citext_eq(), citext_hash(), citext_hash_extended(), citext_ne(), citextcmp(), clauselist_apply_dependencies(), clauselist_selectivity_ext(), clean_NOT_intree(), clean_stopword_intree(), cleanup_subxact_info(), clear_and_pfree(), close_tsvector_parser(), collectMatchBitmap(), combo_encrypt(), combo_free(), combo_init(), CompactCheckpointerRequestQueue(), compareJsonbContainers(), compareStrings(), compile_plperl_function(), compile_pltcl_function(), compileTheLexeme(), compileTheSubstitute(), compute_array_stats(), compute_tsvector_stats(), concat_internal(), connect_pg_server(), construct_empty_expanded_array(), ConstructTupleDescriptor(), convert_any_priv_string(), convert_charset(), convert_column_name(), convert_sourcefiles_in(), convert_string_datum(), convert_to_scalar(), convertPgWchar(), copy_dest_destroy(), copy_file(), copy_table(), CopyArrayEls(), CopyFromErrorCallback(), CopyMultiInsertBufferCleanup(), copyTemplateDependencies(), count_usable_fds(), create_cursor(), create_hash_bounds(), create_partitionwise_grouping_paths(), create_script_for_old_cluster_deletion(), create_secmsg(), create_tablespace_directories(), CreateCheckPoint(), createdb(), createNewConnection(), createPostingTree(), CreateStatistics(), CreateTableSpace(), CreateTrigger(), croak_cstr(), crosstab(), cstr2sv(), datasegpath(), datetime_to_char_body(), datum_image_eq(), datum_to_json(), datum_to_jsonb(), datumSerialize(), db_encoding_convert(), dbase_redo(), dblink_connect(), dblink_disconnect(), dblink_security_check(), DCH_to_char(), deallocate_query(), DebugFileOpen(), DecodeTextArrayToBitmapset(), DeconstructFkConstraintRow(), DefineDomain(), DefineEnum(), DefineIndex(), DefineRange(), DefineType(), deparseConst(), dependencies_clauselist_selectivity(), dependency_degree(), DependencyGenerator_free(), deserialize_deflist(), destroy_tablespace_directories(), DestroyParallelContext(), DestroyTupleQueueReader(), detoast_attr(), detoast_attr_slice(), digest_free(), dintdict_lexize(), dir_realloc(), dispell_lexize(), div_var(), div_var_fast(), do_analyze_rel(), do_autovacuum(), do_compile(), Do_MultiXactIdWait(), do_pg_start_backup(), do_text_output_multiline(), do_to_timestamp(), DoesMultiXactIdConflict(), dofindsubquery(), dotrim(), DropRelationFiles(), DropRelFileNodesAllBuffers(), dsa_detach(), dshash_destroy(), dshash_detach(), dsimple_lexize(), dsm_create(), dsm_detach(), dsm_impl_sysv(), dsnowball_lexize(), dsynonym_init(), dsynonym_lexize(), dxsyn_lexize(), ecpg_filter_source(), ecpg_filter_stderr(), ecpg_postprocess_result(), elog_node_display(), encrypt_free(), end_parallel_vacuum(), end_tup_output(), EndCopy(), EndCopyFrom(), enlarge_list(), entry_dealloc(), entry_purge_tuples(), entryLoadMoreItems(), enum_range_internal(), enum_recv(), EnumValuesCreate(), eqjoinsel_inner(), eqjoinsel_semi(), errfinish(), eval_windowaggregates(), EventTriggerAlterTableEnd(), EventTriggerSQLDropAddObject(), examine_attribute(), examine_expression(), exec_bind_message(), exec_object_restorecon(), exec_stmt_foreach_a(), Exec_UnlistenCommit(), ExecAggTransReparent(), ExecDropSingleTupleTableSlot(), ExecEndWindowAgg(), ExecEvalXmlExpr(), ExecFetchSlotHeapTupleDatum(), ExecFindInitialMatchingSubPlans(), ExecForceStoreHeapTuple(), ExecForceStoreMinimalTuple(), ExecGrant_Attribute(), ExecGrant_Database(), ExecGrant_Fdw(), ExecGrant_ForeignServer(), ExecGrant_Function(), ExecGrant_Language(), ExecGrant_Largeobject(), ExecGrant_Namespace(), ExecGrant_Relation(), ExecGrant_Tablespace(), ExecGrant_Type(), ExecHashIncreaseNumBatches(), ExecHashRemoveNextSkewBucket(), ExecHashTableDestroy(), ExecIndexBuildScanKeys(), ExecInitResultCache(), ExecParallelCleanup(), ExecParallelFinish(), ExecParallelHashCloseBatchAccessors(), ExecParallelHashRepartitionRest(), ExecReScanTidScan(), ExecResetTupleTable(), ExecSetParamPlan(), ExecSetSlotDescriptor(), ExecShutdownGatherMergeWorkers(), ExecShutdownGatherWorkers(), execute_foreign_modify(), executeDateTimeMethod(), executeItemOptUnwrapTarget(), expand_dynamic_library_name(), expanded_record_set_field_internal(), expanded_record_set_fields(), expanded_record_set_tuple(), ExplainFlushWorkersState(), ExplainProperty(), ExplainPropertyFloat(), ExplainPropertyList(), ExplainQuery(), extract_autovac_opts(), extract_rollup_sets(), fetch_finfo_record(), fetch_function_defaults(), fetch_remote_table_info(), fetch_statentries_for_relation(), fetch_table_list(), file_acquire_sample_rows(), filter_list_to_array(), find_in_dynamic_libpath(), find_inheritance_children(), find_provider(), findDependentObjects(), findeq(), findJsonbValueFromContainer(), FinishPreparedTransaction(), fix_merged_indexes(), fixup_inherited_columns(), flush_pipe_input(), FlushRelationsAllBuffers(), fmgr_info_C_lang(), fmgr_info_cxt_security(), forget_invalid_pages(), forget_invalid_pages_db(), form_and_insert_tuple(), free_attrmap(), free_attstatsslot(), free_chromo(), free_conversion_map(), free_edge_table(), free_object_addresses(), free_openssl_cipher(), free_openssl_digest(), free_parsestate(), free_partition_map(), free_pool(), free_sort_tuple(), FreeAccessStrategy(), freeAndGetParent(), FreeBulkInsertState(), FreeErrorData(), FreeExprContext(), FreeFakeRelcacheEntry(), freeGinBtreeStack(), freeHyperLogLog(), FreeQueryDesc(), FreeSnapshot(), FreeSubscription(), freetree(), FreeTriggerDesc(), FreeTupleDesc(), FreeWaitEventSet(), FreezeMultiXactId(), func_get_detail(), FuncnameGetCandidates(), g_int_compress(), g_int_consistent(), g_int_decompress(), g_int_penalty(), g_int_picksplit(), g_intbig_compress(), g_intbig_consistent(), g_intbig_picksplit(), gather_merge_clear_tuples(), gbt_bit_l2n(), gen_ossl_free(), generate_append_tlist(), generate_base_implied_equalities_no_const(), generate_combinations(), generate_dependencies(), generate_matching_part_pairs(), generate_trgm_only(), generate_wildcard_trgm(), generateClonedExtStatsStmt(), generateHeadline(), generator_free(), GenericXLogAbort(), GenericXLogFinish(), get_attstatsslot(), get_const_expr(), get_control_dbstate(), get_docrep(), get_extension_aux_control_filename(), get_extension_script_filename(), get_flush_position(), get_from_clause(), get_relation_statistics(), get_reloptions(), get_sql_insert(), get_sql_update(), get_str_from_var_sci(), get_target_list(), get_tuple_of_interest(), get_typdefault(), GetAggInitVal(), getColorInfo(), getJsonPathVariable(), GetMultiXactIdHintBits(), GetNewRelFileNode(), getNextNearest(), getObjectDescription(), getObjectIdentityParts(), GetRelationPublicationActions(), GetTempNamespaceBackendId(), gin_extract_jsonb_path(), gin_leafpage_items(), gin_trgm_triconsistent(), ginCompressPostingList(), ginendscan(), ginEntryFillRoot(), ginEntryInsert(), ginExtractEntries(), ginFinishSplit(), GinFormTuple(), ginFreeScanKeys(), ginPostingListDecodeAllSegmentsToTbm(), ginVacuumEntryPage(), ginVacuumPostingTree(), ginVacuumPostingTreeLeaf(), gist_indexsortbuild(), gist_indexsortbuild_flush_ready_pages(), gist_ischild(), gistgetbitmap(), gistgettuple(), gistPopItupFromNodeBuffer(), gistRelocateBuildBuffersOnSplit(), gistrescan(), gistunionsubkeyvec(), gistUnloadNodeBuffer(), gtrgm_consistent(), gtrgm_distance(), gtrgm_penalty(), gtsvector_penalty(), GUCArrayReset(), HandleParallelMessages(), hash_record(), hash_record_extended(), hashagg_finish_initial_spills(), hashagg_reset_spill_state(), hashagg_spill_finish(), hashagg_spill_tuple(), hashbpchar(), hashbpcharextended(), hashbuildCallback(), hashendscan(), hashinsert(), hashtext(), hashtextextended(), heap_create_with_catalog(), heap_endscan(), heap_force_common(), heap_free_minimal_tuple(), heap_freetuple(), heap_lock_tuple(), heap_lock_updated_tuple_rec(), heap_modify_tuple(), heap_modify_tuple_by_cols(), heap_tuple_infomask_flags(), heap_tuple_needs_freeze(), heap_vacuum_rel(), heapam_index_fetch_end(), heapam_index_validate_scan(), heapam_relation_copy_for_cluster(), heapam_tuple_complete_speculative(), heapam_tuple_insert(), heapam_tuple_insert_speculative(), heapam_tuple_update(), hmac_finish(), hmac_free(), hmac_init(), hstoreUniquePairs(), hv_fetch_string(), hv_store_string(), index_compute_xid_horizon_for_tuples(), index_concurrently_create_copy(), index_form_tuple(), index_store_float8_orderby_distances(), index_truncate_tuple(), IndexScanEnd(), IndexSupportsBackwardScan(), infix(), init_tour(), initcap(), initialize_reloptions(), InitIndexAmRoutine(), initTrie(), inner_int_inter(), insert_username(), InsertOneTuple(), InsertPgAttributeTuples(), int8_avg_deserialize(), int_md5_free(), int_sha1_free(), int_sha2_free(), intctx_free(), internal_citext_pattern_cmp(), internalerrquery(), intorel_destroy(), intset_subtract(), inv_close(), inv_getsize(), inv_read(), inv_truncate(), inv_write(), InvalidateAttoptCacheCallback(), InvalidateTableSpaceCacheCallback(), irbt_free(), isAnyTempNamespace(), isRelDataFile(), iterate_jsonb_values(), iterate_word_similarity(), jit_release_context(), json_manifest_finalize_file(), json_manifest_finalize_wal_range(), json_manifest_scalar(), json_object(), json_object_keys(), json_object_two_arg(), jsonb_object(), jsonb_object_two_arg(), jsonb_send(), jsonb_set_element(), JsonbDeepContains(), JsonbValue_to_SV(), jsonpath_send(), KnownAssignedXidsDisplay(), lazy_cleanup_one_index(), lazy_scan_heap(), lazy_vacuum_one_index(), lca(), leafRepackItems(), libpq_destroy(), libpqrcv_create_slot(), libpqrcv_disconnect(), libpqrcv_startstreaming(), like_fixed_prefix(), list_delete_nth_cell(), list_free_private(), llvm_compile_module(), llvm_copy_attributes_at_index(), llvm_release_context(), llvm_resolve_symbol(), lo_manage(), load_enum_cache_data(), load_external_function(), load_file(), load_libraries(), load_relcache_init_file(), local_buffer_write_error_callback(), local_destroy(), LockBufferForCleanup(), log_line_prefix(), logfile_rotate(), logical_heap_rewrite_flush_mappings(), logicalrep_relmap_free_entry(), logicalrep_typmap_free_entry(), logicalrep_write_tuple(), LogicalTapeFreeze(), LogicalTapeRewindForRead(), LogicalTapeRewindForWrite(), LogicalTapeSetClose(), LogLogicalInvalidations(), LogRecoveryConflict(), LogStandbySnapshot(), lookup_ts_config_cache(), lookup_var_attr_stats(), lower(), lowerstr_with_len(), lquery_recv(), lquery_send(), ltree_addtext(), ltree_picksplit(), ltree_recv(), ltree_send(), ltree_strncasecmp(), ltree_textadd(), ltxtq_recv(), ltxtq_send(), lz4_compress_datum(), make_greater_string(), make_partition_pruneinfo(), make_partitionedrel_pruneinfo(), make_scalar_key(), make_tsvector(), make_tuple_indirect(), makeMultirangeConstructors(), map_sql_value_to_xml_value(), mark_hl_fragments(), mbuf_free(), mcelem_array_contained_selec(), mcelem_array_selec(), mcelem_tsquery_selec(), mcv_clause_selectivity_or(), mcv_get_match_bitmap(), mdcbuf_free(), mdcreate(), mdopenfork(), mdsyncfiletag(), mdunlinkfiletag(), mdunlinkfork(), merge_acl_with_grant(), merge_clump(), mergeruns(), mkANode(), moddatetime(), mode_final(), moveArrayTypeName(), mp_int_free(), mp_px_rand(), mul_var(), multirange_recv(), MultiXactIdExpand(), MultiXactIdGetUpdateXid(), MultiXactIdIsRunning(), mXactCachePut(), mxid_to_string(), namerecv(), NIImportAffixes(), NIImportDictionary(), NIImportOOAffixes(), NINormalizeWord(), NormalizeSubWord(), NUM_cache(), numeric_abbrev_convert(), numeric_avg_deserialize(), numeric_deserialize(), numeric_fast_cmp(), numeric_float4(), numeric_float8(), numeric_poly_deserialize(), numeric_stddev_pop(), numeric_to_number(), numericvar_to_double_no_overflow(), packArcInfoCmp(), pad_eme_pkcs1_v15(), PageRestoreTempPage(), pagetable_free(), pair_encode(), pairingheap_free(), parallel_process_one_index(), parallel_vacuum_main(), parse_and_validate_value(), parse_args(), parse_extension_control_file(), parse_fcall_arguments(), parse_hba_line(), parse_ident_line(), parse_lquery(), parse_ltree(), parse_manifest_file(), parse_one_reloption(), parse_tsquery(), parseCommandLine(), parseNameAndArgTypes(), parseRelOptionsInternal(), parseServiceFile(), parsetext(), patternsel_common(), pclose_check(), perform_work_item(), PerformAuthentication(), PerformRadiusTransaction(), pg_armor(), pg_attribute_aclmask_ext(), pg_be_scram_build_secret(), pg_class_aclmask_ext(), pg_convert(), pg_crypt(), pg_database_aclmask(), pg_dearmor(), pg_decode_commit_txn(), pg_decode_stream_abort(), pg_decode_stream_commit(), pg_encrypt(), pg_extension_update_paths(), pg_foreign_data_wrapper_aclmask(), pg_foreign_server_aclmask(), pg_get_constraintdef_worker(), pg_get_expr_worker(), pg_get_function_arg_default(), pg_get_indexdef_worker(), pg_get_line(), pg_get_multixact_members(), pg_get_partkeydef_worker(), pg_get_statisticsobj_worker(), pg_get_statisticsobjdef_expressions(), pg_identify_object_as_address(), pg_language_aclmask(), pg_largeobject_aclmask_snapshot(), pg_namespace_aclmask(), pg_plan_query(), pg_proc_aclmask(), pg_replication_origin_create(), pg_replication_origin_drop(), pg_replication_origin_oid(), pg_replication_origin_session_setup(), pg_rewrite_query(), pg_split_opts(), pg_stat_file(), pg_stat_get_activity(), pg_stat_get_backend_activity(), pg_stat_statements_internal(), pg_stop_backup_v2(), pg_tablespace_aclmask(), pg_tablespace_databases(), pg_type_aclmask(), pg_tzenumerate_end(), pg_tzenumerate_next(), pgfnames_cleanup(), PGLC_localeconv(), pglz_compress_datum(), pgp_cfb_free(), pgp_create_pkt_reader(), pgp_free(), pgp_key_free(), pgp_mpi_free(), pgss_shmem_startup(), pgss_store(), pgstat_recv_inquiry(), pkt_stream_free(), pktreader_free(), plainnode(), plperl_build_tuple_result(), plperl_call_perl_func(), plperl_hash_from_tuple(), plperl_modify_tuple(), plperl_spi_exec_prepared(), plperl_spi_prepare(), plperl_spi_query_prepared(), plperl_sv_to_datum(), plperl_trigger_handler(), plperl_util_elog(), plpgsql_destroy_econtext(), plpgsql_extra_checks_check_hook(), plpgsql_subxact_cb(), pltcl_build_tuple_argument(), pltcl_func_handler(), pltcl_quote(), pltcl_set_tuple_values(), pltcl_trigger_handler(), PLy_abort_open_subtransactions(), PLy_cursor_plan(), PLy_elog_impl(), PLy_function_drop_args(), PLy_function_restore_args(), PLy_input_setup_tuple(), PLy_modify_tuple(), PLy_output(), PLy_output_setup_tuple(), PLy_pop_execution_context(), PLy_procedure_compile(), PLy_procedure_create(), PLy_quote_literal(), PLy_quote_nullable(), PLy_spi_execute_plan(), PLy_subtransaction_exit(), PLy_traceback(), PLy_trigger_build_args(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLyNumber_ToJsonbValue(), PLySequence_ToComposite(), PLyString_FromScalar(), PLyUnicode_AsString(), PLyUnicode_Bytes(), PopActiveSnapshot(), PopOverrideSearchPath(), PopTransaction(), populate_array(), populate_array_json(), populate_record(), populate_scalar(), PortalDrop(), postgresExecForeignTruncate(), postgresGetForeignJoinPaths(), PostmasterMain(), PostPrepare_smgr(), pprint(), pq_endmessage(), pq_puttextmessage(), pq_sendcountedtext(), pq_sendstring(), pq_sendtext(), pq_writestring(), PrepareTempTablespaces(), PrescanPreparedTransactions(), print(), print_expr(), print_function_arguments(), PrintBufferLeakWarning(), printtup_destroy(), printtup_prepare_info(), printtup_shutdown(), ProcArrayApplyRecoveryInfo(), process_ordered_aggregate_single(), process_pipe_input(), process_target_wal_block_change(), ProcessCommittedInvalidationMessages(), ProcessGUCArray(), ProcessStandbyHSFeedbackMessage(), ProcessStandbyReplyMessage(), ProcessWalSndrMessage(), ProcSleep(), prs_process_call(), prune_element_hashtable(), prune_lexemes_hashtable(), psprintf(), pullf_free(), pushf_free(), PushTransaction(), pushval_morph(), px_find_cipher(), px_find_combo(), px_find_digest(), QTNFree(), QTNTernary(), queryin(), quote_object_name(), range_recv(), rbt_populate(), RE_compile(), RE_compile_and_cache(), RE_execute(), read_client_final_message(), read_dictionary(), readfile(), readstoplist(), recomputeNamespacePath(), record_cmp(), record_eq(), record_image_cmp(), record_image_eq(), record_in(), record_out(), record_recv(), record_send(), recordMultipleDependencies(), RecordTransactionAbort(), RecordTransactionCommit(), RecoverPreparedTransactions(), recursive_revoke(), recv_password_packet(), regex_fixed_prefix(), RehashCatCache(), reindex_one_database(), ReinitializeParallelDSM(), RelationBuildPartitionKey(), RelationBuildRowSecurity(), RelationBuildRuleLock(), RelationBuildTriggers(), RelationBuildTupleDesc(), RelationCacheInitializePhase3(), RelationClearRelation(), RelationDestroyRelation(), RelationGetDummyIndexExpressions(), RelationGetIndexAttOptions(), RelationGetIndexExpressions(), RelationGetIndexPredicate(), RelationParseRelOptions(), RelationPreserveStorage(), RelationReloadIndexInfo(), ReleaseDummy(), relmap_redo(), RememberSyncRequest(), remove_cache_entry(), remove_dbtablespaces(), RemoveLocalLock(), RenameTypeInternal(), ReorderBufferFreeSnap(), ReorderBufferIterTXNFinish(), ReorderBufferReturnChange(), ReorderBufferReturnRelids(), ReorderBufferReturnTupleBuf(), ReorderBufferReturnTXN(), ReorderBufferToastReplace(), ReorderBufferToastReset(), reorderqueue_pop(), replace_auto_config_value(), replace_text(), replace_text_regexp(), ReplicationSlotDropAtPubNode(), report_corruption_internal(), report_invalid_page(), report_triggers(), report_untranslatable_char(), reportDependentObjects(), ReportGUCOption(), reset_on_dsm_detach(), ResetDecoder(), resetSpGistScanOpaque(), resolve_aggregate_transtype(), ResolveRecoveryConflictWithVirtualXIDs(), ResourceArrayEnlarge(), ResourceArrayFree(), ResourceOwnerDelete(), RestoreArchivedFile(), rewriteTargetListIU(), rewriteValuesRTE(), rm_redo_error_callback(), RS_free(), run_ssl_passphrase_command(), s_free(), scanPendingInsert(), scram_verify_plain_password(), select_active_windows(), select_outer_pathkeys_for_merge(), send_message_to_frontend(), send_message_to_server_log(), SendFunctionResult(), sepgsql_attribute_drop(), sepgsql_attribute_post_create(), sepgsql_attribute_relabel(), sepgsql_attribute_setattr(), sepgsql_avc_check_perms(), sepgsql_avc_compute(), sepgsql_avc_reclaim(), sepgsql_database_drop(), sepgsql_database_post_create(), sepgsql_database_relabel(), sepgsql_database_setattr(), sepgsql_proc_drop(), sepgsql_proc_execute(), sepgsql_proc_post_create(), sepgsql_proc_relabel(), sepgsql_proc_setattr(), sepgsql_relation_drop(), sepgsql_relation_post_create(), sepgsql_relation_relabel(), sepgsql_relation_setattr(), sepgsql_relation_truncate(), sepgsql_schema_drop(), sepgsql_schema_post_create(), sepgsql_schema_relabel(), sepgsql_xact_callback(), seq_redo(), seq_search_localized(), serialize_deflist(), set_append_rel_size(), set_customscan_references(), set_foreignscan_references(), set_indexonlyscan_references(), set_join_references(), set_plan_refs(), set_returning_clause_references(), set_subquery_pathlist(), set_upper_references(), set_var_from_str(), SetClientEncoding(), setCorrLex(), setNewTmpRes(), setup_regexp_matches(), setup_test_matches(), shared_buffer_write_error_callback(), shdepLockAndCheckObject(), shm_mq_detach(), shm_mq_receive(), show_resultcache_info(), show_trgm(), ShowAllGUCConfig(), ShowTransactionStateRec(), ShowUsage(), ShutdownExprContext(), SignalBackends(), similarity(), single_encode(), smgr_desc(), smgrDoPendingDeletes(), smgrDoPendingSyncs(), smgrdounlinkall(), SnapBuildFreeSnapshot(), SnapBuildPurgeCommittedTxn(), SnapBuildRestore(), SnapBuildSerialize(), spg_box_quad_inner_consistent(), spgClearPendingList(), spgdoinsert(), spgendscan(), spgFreeSearchItem(), spggettuple(), spgRedoVacuumRedirect(), SPI_cursor_open(), SPI_modifytuple(), SPI_pfree(), SPI_sql_row_to_xmlelement(), split_text(), SplitIdentifierString(), SplitToVariants(), sqlfunction_destroy(), StandbyRecoverPreparedTransactions(), StandbyReleaseLockList(), StandbyTransactionIdIsPrepared(), StartPrepare(), startScanEntry(), StartupRereadConfig(), StartupXLOG(), statext_mcv_build(), statext_mcv_deserialize(), statext_mcv_serialize(), StoreAttrDefault(), storeObjectDescription(), StorePartitionKey(), StoreRelCheck(), storeRow(), str_initcap(), str_numth(), str_tolower(), str_toupper(), stream_cleanup_files(), string_to_text(), stringToQualifiedNameList(), sts_end_write(), sts_read_tuple(), subxact_info_write(), SyncPostCheckpoint(), SyncRepGetNthLatestSyncRecPtr(), SyncRepGetSyncRecPtr(), SyncRepWaitForLSN(), SysLogger_Start(), SysLoggerMain(), systable_endscan(), systable_endscan_ordered(), tablesample_init(), TablespaceCreateDbspace(), tbm_end_iterate(), tbm_end_shared_iterate(), tbm_free(), terminate_brin_buildstate(), test_enc_conversion(), test_re_compile(), test_shm_mq_setup(), test_singlerowmode(), testdelete(), testprs_end(), text2ltree(), text_format(), text_format_string_conversion(), text_substring(), text_to_cstring(), text_to_cstring_buffer(), textrecv(), textToQualifiedNameList(), thesaurus_lexize(), thesaurusRead(), TidListEval(), toast_build_flattened_tuple(), toast_close_indexes(), toast_compress_datum(), toast_flatten_tuple(), toast_flatten_tuple_to_datum(), toast_tuple_cleanup(), toast_tuple_externalize(), toast_tuple_try_compression(), tokenize_inc_file(), TParserClose(), TParserCopyClose(), TParserGet(), tqueueDestroyReceiver(), tqueueReceiveSlot(), transformRangeTableFunc(), transientrel_destroy(), try_partitionwise_join(), ts_accum(), ts_headline_byid_opt(), ts_headline_json_byid_opt(), ts_headline_jsonb_byid_opt(), ts_lexize(), ts_match_tq(), ts_match_tt(), ts_process_call(), ts_stat_sql(), tsearch_readline(), tsearch_readline_end(), tsquery_rewrite_query(), tsqueryrecv(), tsquerytree(), tstoreDestroyReceiver(), tstoreReceiveSlot_detoast(), tstoreShutdownReceiver(), tsvector_delete_arr(), tsvector_to_array(), tsvector_update_trigger(), tsvectorin(), tt_process_call(), ttdummy(), tts_virtual_clear(), tuple_data_split(), tuple_data_split_internal(), tuplesort_begin_batch(), tuplesort_begin_cluster(), tuplesort_begin_index_btree(), tuplestore_advance(), tuplestore_clear(), tuplestore_end(), tuplestore_skiptuples(), tuplestore_trim(), typenameTypeMod(), unaccent_dict(), uniqueentry(), uniqueWORD(), unistr(), UnregisterExprContextCallback(), UnregisterResourceReleaseCallback(), UnregisterSubXactCallback(), UnregisterXactCallback(), updateAclDependencies(), UpdateIndexRelation(), UpdateLogicalMappings(), upper(), vac_close_indexes(), varcharrecv(), varlenafastcmp_locale(), varstr_abbrev_convert(), varstr_cmp(), varstrfastcmp_c(), varstrfastcmp_locale(), verify_backup_checksums(), verify_backup_directory(), WaitForOlderSnapshots(), WaitForParallelWorkersToExit(), WaitOnLock(), walrcv_clear_result(), WalRcvFetchTimeLineHistoryFiles(), WalReceiverMain(), worker_freeze_result_tape(), write_auto_conf_file(), write_console(), write_csvlog(), writetup_datum(), writetup_index(), X509_NAME_field_to_text(), X509_NAME_to_cstring(), xact_desc_relations(), XLogDecodeOneRecord(), XLogDumpDisplayRecord(), XLogInsertRecord(), XLogPrefetcherFree(), XLogReaderAllocate(), XLogReaderFree(), XLogReleasePreviousRecord(), XLOGShmemInit(), xml_encode_special_chars(), xml_is_document(), xml_out_internal(), xml_recv(), xml_send(), xmlconcat(), xmlpi(), xpath_bool(), xpath_list(), xpath_nodeset(), xpath_number(), xpath_string(), and xpath_table().

1170 {
1171  MemoryContext context = GetMemoryChunkContext(pointer);
1172 
1173  context->methods->free_p(context, pointer);
1174  VALGRIND_MEMPOOL_FREE(context, pointer);
1175 }
const MemoryContextMethods * methods
Definition: memnodes.h:85
void(* free_p)(MemoryContext context, void *pointer)
Definition: memnodes.h:62
#define VALGRIND_MEMPOOL_FREE(context, addr)
Definition: memdebug.h:30
static MemoryContext GetMemoryChunkContext(void *pointer)
Definition: memutils.h:114

◆ pnstrdup()

char* pnstrdup ( const char *  in,
Size  len 
)

◆ ProcessLogMemoryContextInterrupt()

void ProcessLogMemoryContextInterrupt ( void  )

Definition at line 1041 of file mcxt.c.

References ereport, errmsg(), LOG, LogMemoryContextPending, MemoryContextStatsDetail(), and MyProcPid.

Referenced by GetMemoryChunkContext(), and ProcessInterrupts().

1042 {
1043  LogMemoryContextPending = false;
1044 
1045  ereport(LOG,
1046  (errmsg("logging memory contexts of PID %d", MyProcPid)));
1047 
1048  /*
1049  * When a backend process is consuming huge memory, logging all its memory
1050  * contexts might overrun available disk space. To prevent this, we limit
1051  * the number of child contexts to log per parent to 100.
1052  *
1053  * As with MemoryContextStats(), we suppose that practical cases where the
1054  * dump gets long will typically be huge numbers of siblings under the
1055  * same parent context; while the additional debugging value from seeing
1056  * details about individual siblings beyond 100 will not be large.
1057  */
1059 }
int MyProcPid
Definition: globals.c:43
#define LOG
Definition: elog.h:26
void MemoryContextStatsDetail(MemoryContext context, int max_children, bool print_to_stderr)
Definition: mcxt.c:520
MemoryContext TopMemoryContext
Definition: mcxt.c:48
#define ereport(elevel,...)
Definition: elog.h:157
volatile sig_atomic_t LogMemoryContextPending
Definition: globals.c:38
int errmsg(const char *fmt,...)
Definition: elog.c:909

◆ pstrdup()

char* pstrdup ( const char *  in)

Definition at line 1299 of file mcxt.c.

Referenced by _ShowOption(), add_row_identity_var(), add_with_check_options(), addCompiledLexeme(), addRangeTableEntryForFunction(), addRangeTableEntryForSubquery(), addRangeTableEntryForTableFunc(), addRangeTableEntryForValues(), addToResult(), adjust_partition_tlist(), allocate_reloption(), AlterRole(), analyzeCTETargetList(), append_database_pattern(), append_relation_pattern_helper(), append_schema_pattern(), ApplyRetrieveRule(), array_in(), array_out(), ATExecAddIndexConstraint(), ATParseTransformCmd(), ATPrepSetNotNull(), auth_peer(), AuxiliaryProcessMain(), backend_read_statsfile(), BeginCopyFrom(), BeginCopyTo(), BufFileCreateShared(), BufFileOpenShared(), build_datatype(), build_minmax_path(), build_server_first_message(), buildDefItem(), BuildOnConflictExcludedTargetlist(), buildRelationAliases(), BuildRestoreCommand(), cache_locale_time(), CatalogCacheInitializeCache(), check_datestyle(), check_hostname(), check_ident_usermap(), check_locale(), check_log_destination(), check_search_path(), check_selective_binary_conversion(), check_temp_tablespaces(), check_timezone(), check_tuple_header(), check_tuple_visibility(), check_valid_internal_signature(), check_wal_consistency_checking(), checkInsertTargets(), ChooseExtendedStatisticNameAddition(), ChooseForeignKeyConstraintNameAddition(), ChooseIndexColumnNames(), ChooseIndexNameAddition(), CloneFkReferencing(), CloneRowTriggersToPartition(), compile_database_list(), compile_plperl_function(), compile_pltcl_function(), compile_relation_list_one_db(), compileTheSubstitute(), connectby_text(), connectby_text_serial(), convert_string_datum(), CopyCachedPlan(), CopyErrorData(), CopyTriggerDesc(), copyTSLexeme(), CopyVar(), create_foreign_modify(), CreateCachedPlan(), CreateLockFile(), createNewConnection(), CreateParallelContext(), CreateSchemaCommand(), CreateTableSpace(), CreateTupleDescCopyConstr(), cstring_in(), cstring_out(), date_out(), defGetString(), DefineCollation(), DefineQueryRewrite(), DefineView(), DefineViewRules(), deleteConnection(), destroy_tablespace_directories(), DetachPartitionFinalize(), determineRecursiveColTypes(), do_compile(), do_pg_start_backup(), DoCopy(), DropSubscription(), dsynonym_init(), ean13_out(), encrypt_password(), enum_out(), EventTriggerSQLDropAddObject(), exec_bind_message(), exec_execute_message(), Exec_ListenCommit(), executeItemOptUnwrapTarget(), expand_dynamic_library_name(), expand_inherited_rtentry(), expand_single_inheritance_child(), expand_targetlist(), ExpandRowReference(), expandRTE(), expandTableLikeClause(), expandTupleDesc(), ExportSnapshot(), extension_file_exists(), ExtractExtensionList(), fetch_statentries_for_relation(), fill_hba_line(), filter_list_to_array(), find_plan(), float8in_internal_opt_error(), fmgr_symbol(), format_operator_parts(), format_procedure_parts(), format_type_extended(), from_char_seq_search(), generate_append_tlist(), generate_setop_tlist(), generateClonedIndexStmt(), get_am_name(), get_attname(), get_collation(), get_collation_actual_version(), get_collation_name(), get_configdata(), get_connect_string(), get_constraint_name(), get_database_list(), get_database_name(), get_db_info(), get_ext_ver_info(), get_ext_ver_list(), get_extension_name(), get_extension_script_directory(), get_file_fdw_attribute_options(), get_func_name(), get_language_name(), get_namespace_name(), get_opclass(), get_opname(), get_publication_name(), get_rel_name(), get_rolespec_name(), get_source_line(), get_sql_insert(), get_sql_update(), get_string_attr(), get_subscription_list(), get_subscription_name(), get_tablespace_name(), GetConfigOptionByNum(), getConnectionByName(), GetDatabasePath(), GetForeignDataWrapperExtended(), GetForeignServerExtended(), getObjectIdentityParts(), getOpFamilyIdentity(), GetPublication(), getRelationIdentity(), GetSubscription(), GetUserNameFromId(), HandleParallelMessage(), heap_vacuum_rel(), hstore_out(), ImportForeignSchema(), indent_lines(), init_sql_fcache(), initialize_worker_spi(), internal_yylex(), interpret_AS_clause(), interpret_function_parameter_list(), interval_out(), isn_out(), iterate_values_object_field_start(), lazy_cleanup_one_index(), lazy_vacuum_one_index(), libpqrcv_check_conninfo(), libpqrcv_create_slot(), libpqrcv_get_conninfo(), libpqrcv_get_senderinfo(), libpqrcv_identify_system(), libpqrcv_readtimelinehistoryfile(), limit_printout_length(), llvm_create_types(), llvm_resolve_symbol(), llvm_split_symbol_name(), load_domaintype_info(), load_libraries(), logicalrep_partition_open(), logicalrep_read_attrs(), logicalrep_read_origin(), logicalrep_read_rel(), logicalrep_read_typ(), logicalrep_relmap_update(), logicalrep_typmap_update(), lowerstr_with_len(), main(), makeAlias(), makeColumnDef(), makeMultirangeTypeName(), makeUniqueTypeName(), map_sql_value_to_xml_value(), merge_children(), MergeAttributes(), nameout(), network_out(), NINormalizeWord(), NormalizeSubWord(), numeric_normalize(), numeric_out(), numeric_out_sci(), object_to_string(), okeys_object_field_start(), parallel_vacuum_main(), parse_extension_control_file(), parse_hba_auth_opt(), parse_hba_line(), parse_ident_line(), parse_object_field(), parse_scalar(), parse_scram_secret(), parseNameAndArgTypes(), ParseTzFile(), perform_base_backup(), PerformCursorOpen(), pg_available_extension_versions(), pg_available_extensions(), pg_be_scram_exchange(), pg_collation_actual_version(), pg_event_trigger_ddl_commands(), pg_import_system_collations(), pg_lsn_out(), pg_split_opts(), pg_tzenumerate_next(), pg_tzenumerate_start(), pgfnames(), PGLC_localeconv(), pgrowlocks(), pgstat_recv_inquiry(), pgstatindex_impl(), plperl_init_interp(), plperl_to_hstore(), plpgsql_build_recfield(), plpgsql_build_record(), plpgsql_build_variable(), plpgsql_compile_inline(), plpgsql_extra_checks_check_hook(), plsample_func_handler(), pltcl_set_tuple_values(), PLy_output(), PLy_procedure_create(), PLyObject_AsString(), PLyUnicode_AsString(), populate_scalar(), postgresImportForeignSchema(), PostmasterMain(), pq_parse_errornotice(), prepare_foreign_modify(), prepare_sql_fn_parse_info(), PrepareTempTablespaces(), preprocess_targetlist(), print_function_sqlbody(), process_psqlrc(), ProcessGUCArray(), ProcessStandbyHSFeedbackMessage(), ProcessStandbyReplyMessage(), ProcessStartupPacket(), ProcessWalSndrMessage(), prsd_headline(), prsd_lextype(), pset_value_string(), px_find_combo(), range_deparse(), read_client_final_message(), read_client_first_message(), read_dictionary(), read_extension_control_file(), read_tablespace_map(), RebuildConstraintComment(), recomputeNamespacePath(), regclassout(), regcollationout(), regconfigout(), regdictionaryout(), register_label_provider(), regnamespaceout(), regoperatorout(), regoperout(), regprocedureout(), regprocout(), regroleout(), regtypeout(), ReindexPartitions(), RelationBuildTriggers(), RemoveInheritance(), ReorderBufferFinishPrepared(), ReorderBufferPrepare(), ReorderBufferQueueMessage(), replace_auto_config_value(), ReThrowError(), rewriteTargetListIU(), rewriteTargetView(), sepgsql_avc_compute(), sepgsql_compute_create(), sepgsql_get_label(), sepgsql_mcstrans_in(), sepgsql_mcstrans_out(), sepgsql_set_client_label(), set_relation_column_names(), show_eval_params(), show_sort_group_keys(), SPI_fname(), SPI_getrelname(), SPI_gettype(), SplitDirectoriesString(), splitTzLine(), StartupRereadConfig(), StreamServerPort(), stringToQualifiedNameList(), strip_trailing_ws(), substitute_libpath_macro(), SysLoggerMain(), TablespaceCreateDbspace(), test_rls_hooks_permissive(), test_rls_hooks_restrictive(), testprs_lextype(), textToQualifiedNameList(), thesaurus_init(), throw_tcl_error(), ThrowErrorData(), tidout(), time_out(), timestamp_out(), timestamptz_out(), timetz_out(), tokenize_file(), tokenize_inc_file(), transformFkeyGetPrimaryKey(), transformIndexConstraint(), transformOfType(), transformRangeTableFunc(), transformRowExpr(), transformSetOperationStmt(), transformTableLikeClause(), tsearch_readline(), typeTypeName(), unknownin(), unknownout(), untransformRelOptions(), utf_e2u(), utf_u2e(), verify_backup_directory(), void_out(), wait_result_to_str(), X509_NAME_to_cstring(), xml_is_document(), and xpstrdup().

1300 {
1302 }
MemoryContext CurrentMemoryContext
Definition: mcxt.c:42
char * MemoryContextStrdup(MemoryContext context, const char *string)
Definition: mcxt.c:1286

◆ repalloc()

void* repalloc ( void *  pointer,
Size  size 
)

Definition at line 1182 of file mcxt.c.

Referenced by _bt_deadblocks(), _bt_pendingfsm_add(), _fdvec_resize(), accumArrayResult(), accumArrayResultArr(), add_column_to_pathtarget(), add_exact_object_address(), add_exact_object_address_extra(), add_gin_entry(), add_object_address(), add_reloption(), addCompiledLexeme(), addCompoundAffixFlagValue(), addDatum(), AddStem(), addToArray(), addWrd(), AfterTriggerBeginSubXact(), AfterTriggerEnlargeQueryState(), appendElement(), appendKey(), apply_handle_stream_commit(), array_set_element_expanded(), AtSubCommit_childXids(), bms_add_member(), bms_add_range(), brin_copy_tuple(), BufferSync(), BufFileAppend(), BufFileOpenShared(), checkcondition_str(), checkSharedDependencies(), compileTheLexeme(), compileTheSubstitute(), CopyReadAttributesCSV(), CopyReadAttributesText(), count_usable_fds(), cube_inter(), dsnowball_lexize(), dsynonym_init(), dxsyn_lexize(), enlarge_list(), enlargeStringInfo(), ensure_record_cache_typmod_slot_exists(), enum_range_internal(), ExecHashIncreaseNumBatches(), ExecHashIncreaseNumBuckets(), ExecIndexBuildScanKeys(), ExecInitPartitionDispatchInfo(), ExecInitRoutingInfo(), expand_colnames_array_to(), expand_planner_arrays(), ExprEvalPushStep(), extendBufFile(), find_inheritance_children(), find_plan(), findDependentObjects(), generate_dependencies_recurse(), generateHeadline(), get_docrep(), GetComboCommandId(), GetLockStatusData(), GetSingleProcBlockerStatusData(), gettoken_tsvector(), ginFillScanEntry(), GinFormTuple(), ginHeapTupleFastCollect(), ginPostingListDecodeAllSegments(), gistAddLoadedBuffer(), gistBuffersReleaseBlock(), gistGetNodeBuffer(), gistjoinvector(), gtsvector_compress(), hashagg_tapeinfo_release(), hladdword(), hlfinditem(), load_domaintype_info(), load_enum_cache_data(), load_relcache_init_file(), LockAcquireExtended(), LogicalTapeSetExtend(), ltsGetPreallocBlock(), ltsReleaseBlock(), LWLockRegisterTranche(), MakeSharedInvalidMessagesArray(), mark_hl_fragments(), MergeAffix(), multirange_in(), newLexeme(), newLOfd(), NIAddAffix(), NIAddSpell(), NISortAffixes(), oidvectortypes(), okeys_object_field_start(), parse_hstore(), parsetext(), perform_default_encoding_conversion(), pg_do_encoding_conversion(), pg_import_system_collations(), pgfnames(), pgss_shmem_startup(), plainnode(), plpgsql_adddatum(), prepare_room(), PrescanPreparedTransactions(), prs_setup_firstcall(), pushval_asis(), pushValue(), QTNTernary(), read_dictionary(), readstoplist(), record_corrupt_item(), RecordConstLocation(), RelationBuildRuleLock(), RelationBuildTriggers(), RememberToFreeTupleDescAtEOX(), ReorderBufferAddInvalidations(), ReorderBufferSerializeReserve(), RequestNamedLWLockTranche(), resize_intArrayType(), s_realloc(), SetConstraintStateAddItem(), setup_regexp_matches(), setup_test_matches(), smgrDoPendingDeletes(), smgrDoPendingSyncs(), SnapBuildAddCommittedTxn(), socket_putmessage_noblock(), SPI_connect_ext(), SPI_repalloc(), statext_dependencies_build(), statext_dependencies_deserialize(), statext_mcv_deserialize(), str_udeescape(), subxact_info_add(), TidListEval(), tsqueryrecv(), tsvectorin(), tsvectorrecv(), tuplestore_alloc_read_pointer(), uniqueentry(), uniqueWORD(), variable_paramref_hook(), XLogEnsureRecordSpace(), xml_is_document(), and xslt_process().

1183 {
1184  MemoryContext context = GetMemoryChunkContext(pointer);
1185  void *ret;
1186 
1187  if (!AllocSizeIsValid(size))
1188  elog(ERROR, "invalid memory alloc request size %zu", size);
1189 
1190  AssertNotInCriticalSection(context);
1191 
1192  /* isReset must be false already */
1193  Assert(!context->isReset);
1194 
1195  ret = context->methods->realloc(context, pointer, size);
1196  if (unlikely(ret == NULL))
1197  {
1199  ereport(ERROR,
1200  (errcode(ERRCODE_OUT_OF_MEMORY),
1201  errmsg("out of memory"),
1202  errdetail("Failed on request of size %zu in memory context \"%s\".",
1203  size, context->name)));
1204  }
1205 
1206  VALGRIND_MEMPOOL_CHANGE(context, pointer, ret, size);
1207 
1208  return ret;
1209 }
const MemoryContextMethods * methods
Definition: memnodes.h:85
int errcode(int sqlerrcode)
Definition: elog.c:698
#define AssertNotInCriticalSection(context)
Definition: mcxt.c:73
void *(* realloc)(MemoryContext context, void *pointer, Size size)
Definition: memnodes.h:63
#define ERROR
Definition: elog.h:46
#define VALGRIND_MEMPOOL_CHANGE(context, optr, nptr, size)
Definition: memdebug.h:31
void MemoryContextStats(MemoryContext context)
Definition: mcxt.c:505
int errdetail(const char *fmt,...)
Definition: elog.c:1042
MemoryContext TopMemoryContext
Definition: mcxt.c:48
#define AllocSizeIsValid(size)
Definition: memutils.h:42
#define ereport(elevel,...)
Definition: elog.h:157
#define Assert(condition)
Definition: c.h:804
int errmsg(const char *fmt,...)
Definition: elog.c:909
#define elog(elevel,...)
Definition: elog.h:232
#define unlikely(x)
Definition: c.h:273
const char * name
Definition: memnodes.h:90
static MemoryContext GetMemoryChunkContext(void *pointer)
Definition: memutils.h:114

◆ repalloc_huge()

void* repalloc_huge ( void *  pointer,
Size  size 
)

Definition at line 1252 of file mcxt.c.

References AllocHugeSizeIsValid, Assert, AssertNotInCriticalSection, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, GetMemoryChunkContext(), MemoryContextData::isReset, MemoryContextStats(), MemoryContextData::methods, MemoryContextData::name, MemoryContextMethods::realloc, unlikely, and VALGRIND_MEMPOOL_CHANGE.

Referenced by ginCombineData(), grow_memtuples(), and spi_printtup().

1253 {
1254  MemoryContext context = GetMemoryChunkContext(pointer);
1255  void *ret;
1256 
1257  if (!AllocHugeSizeIsValid(size))
1258  elog(ERROR, "invalid memory alloc request size %zu", size);
1259 
1260  AssertNotInCriticalSection(context);
1261 
1262  /* isReset must be false already */
1263  Assert(!context->isReset);
1264 
1265  ret = context->methods->realloc(context, pointer, size);
1266  if (unlikely(ret == NULL))
1267  {
1269  ereport(ERROR,
1270  (errcode(ERRCODE_OUT_OF_MEMORY),
1271  errmsg("out of memory"),
1272  errdetail("Failed on request of size %zu in memory context \"%s\".",
1273  size, context->name)));
1274  }
1275 
1276  VALGRIND_MEMPOOL_CHANGE(context, pointer, ret, size);
1277 
1278  return ret;
1279 }
const MemoryContextMethods * methods
Definition: memnodes.h:85
int errcode(int sqlerrcode)
Definition: elog.c:698
#define AssertNotInCriticalSection(context)
Definition: mcxt.c:73
void *(* realloc)(MemoryContext context, void *pointer, Size size)
Definition: memnodes.h:63
#define ERROR
Definition: elog.h:46
#define VALGRIND_MEMPOOL_CHANGE(context, optr, nptr, size)
Definition: memdebug.h:31
void MemoryContextStats(MemoryContext context)
Definition: mcxt.c:505
int errdetail(const char *fmt,...)
Definition: elog.c:1042
MemoryContext TopMemoryContext
Definition: mcxt.c:48
#define ereport(elevel,...)
Definition: elog.h:157
#define Assert(condition)
Definition: c.h:804
#define AllocHugeSizeIsValid(size)
Definition: memutils.h:46
int errmsg(const char *fmt,...)
Definition: elog.c:909
#define elog(elevel,...)
Definition: elog.h:232
#define unlikely(x)
Definition: c.h:273
const char * name
Definition: memnodes.h:90
static MemoryContext GetMemoryChunkContext(void *pointer)
Definition: memutils.h:114

Variable Documentation

◆ CacheMemoryContext

MemoryContext CacheMemoryContext = NULL

Definition at line 51 of file mcxt.c.

Referenced by _SPI_save_plan(), AllocateRelationDesc(), assign_record_type_typmod(), AttrDefaultFetch(), BuildEventTriggerCache(), BuildHardcodedDescriptor(), CatalogCacheCreateEntry(), CatalogCacheInitializeCache(), CheckConstraintFetch(), CreateCacheMemoryContext(), ensure_record_cache_typmod_slot_exists(), generate_partition_qual(), get_attribute_options(), get_rel_sync_entry(), get_tablespace(), GetCachedExpression(), GetCachedPlan(), GetFdwRoutineForRelation(), GetRelationPublicationActions(), init_ts_config_cache(), InitCatCache(), InitializeAttoptCache(), InitializeRelfilenodeMap(), InitializeTableSpaceCache(), load_domaintype_info(), load_enum_cache_data(), load_rangetype_info(), load_relcache_init_file(), logicalrep_partmap_init(), logicalrep_relmap_init(), lookup_ts_config_cache(), lookup_ts_dictionary_cache(), lookup_ts_parser_cache(), lookup_type_cache(), LookupOpclassInfo(), maybe_send_schema(), pgoutput_startup(), process_syncing_tables_for_apply(), register_on_commit_action(), RehashCatCache(), RelationBuildLocalRelation(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationBuildRowSecurity(), RelationBuildRuleLock(), RelationBuildTriggers(), RelationBuildTupleDesc(), RelationCacheInitialize(), RelationCacheInitializePhase2(), RelationCacheInitializePhase3(), RelationGetFKeyList(), RelationGetIndexAttrBitmap(), RelationGetIndexList(), RelationGetStatExtList(), RelationInitIndexAccessInfo(), RelationParseRelOptions(), RememberToFreeTupleDescAtEOX(), SaveCachedPlan(), SearchCatCacheList(), set_schema_sent_in_streamed_txn(), and SPI_keepplan().

◆ CurrentMemoryContext

MemoryContext CurrentMemoryContext = NULL

Definition at line 42 of file mcxt.c.

Referenced by _bt_load(), _bt_preprocess_array_keys(), _hash_finish_split(), _SPI_commit(), _SPI_rollback(), _SPI_save_plan(), advance_windowaggregate(), advance_windowaggregate_base(), afterTriggerInvokeEvents(), AllocateSnapshotBuilder(), array_agg_array_finalfn(), array_agg_finalfn(), array_positions(), array_to_datum_internal(), AttachPartitionEnsureIndexes(), begin_heap_rewrite(), BeginCopyFrom(), BeginCopyTo(), blbuild(), blinsert(), brin_build_desc(), brin_minmax_multi_summary_out(), brin_minmax_multi_union(), brin_new_memtuple(), bringetbitmap(), brininsert(), bt_check_every_level(), btree_xlog_startup(), btvacuumscan(), build_join_rel_hash(), BuildCachedPlan(), BuildParamLogString(), BuildRelationExtStatistics(), CloneRowTriggersToPartition(), CompactCheckpointerRequestQueue(), compactify_ranges(), CompleteCachedPlan(), compute_array_stats(), compute_expr_stats(), compute_scalar_stats(), compute_tsvector_stats(), ComputeExtStatisticsRows(), CopyCachedPlan(), CopyErrorData(), CopyFrom(), create_toast_table(), CreateCachedPlan(), CreateExecutorState(), CreateOneShotCachedPlan(), CreateSchemaCommand(), CreateStandaloneExprContext(), createTempGistContext(), createTrgmNFA(), CreateTrigger(), DatumGetExpandedArray(), DatumGetExpandedArrayX(), DatumGetExpandedRecord(), datumTransfer(), dblink_get_connections(), DebugFileOpen(), DiscreteKnapsack(), do_analyze_rel(), do_start_worker(), DoCopyTo(), domain_check(), dsnowball_init(), each_worker(), each_worker_jsonb(), elements_worker(), elements_worker_jsonb(), ensure_free_space_in_buffer(), ensure_transaction(), eval_windowfunction(), EventTriggerInvoke(), examine_expression(), exec_replication_command(), exec_stmt_block(), ExecAggTransReparent(), ExecAppendAsyncEventWait(), ExecCreatePartitionPruneState(), ExecEvalHashedScalarArrayOp(), ExecHashTableCreate(), ExecInitCoerceToDomain(), ExecInitFunctionScan(), ExecInitGatherMerge(), ExecInitIndexScan(), ExecInitMergeAppend(), ExecInitModifyTable(), ExecInitProjectSet(), ExecInitPruningContext(), ExecInitRecursiveUnion(), ExecInitResultCache(), ExecInitSetOp(), ExecInitSubPlan(), ExecInitTableFuncScan(), ExecInitWindowAgg(), ExecMakeTableFunctionResult(), ExecScanSubPlan(), ExecSetParamPlan(), ExecSetupPartitionTupleRouting(), execute_sql_string(), ExecuteTruncateGuts(), fetch_array_arg_replace_nulls(), file_acquire_sample_rows(), fill_hba_view(), finalize_aggregate(), finalize_partialaggregate(), finalize_windowaggregate(), find_all_inheritors(), find_partition_scheme(), fmgr_info(), fmgr_info_other_lang(), geqo_eval(), get_actual_variable_range(), get_altertable_subcmdtypes(), get_database_list(), get_json_object_as_hash(), get_subscription_list(), GetCachedExpression(), GetConnection(), GetErrorContextStack(), gin_extract_query_trgm(), gin_xlog_startup(), ginbeginscan(), ginbuild(), ginbulkdelete(), gininsert(), ginInsertCleanup(), ginPlaceToPage(), gistbuild(), gistInitBuildBuffers(), gistInitParentMap(), gistvacuumscan(), IdentifySystem(), initBloomState(), initGinState(), initGISTstate(), initialize_peragg(), initTrie(), inline_function(), inline_set_returning_function(), intset_create(), libpqrcv_processTuples(), load_domaintype_info(), load_tzoffsets(), makeIndexInfo(), makeNumericAggStateCurrentContext(), MakeTupleTableSlot(), MemoryContextSwitchTo(), MJExamineQuals(), multi_sort_add_dimension(), NextCopyFrom(), NIAddAffix(), optionListToArray(), palloc(), palloc0(), palloc_extended(), ParallelWorkerMain(), parse_ident(), perform_default_encoding_conversion(), perform_work_item(), pg_buffercache_pages(), pg_do_encoding_conversion(), pg_get_statisticsobjdef_expressions(), pg_stats_ext_mcvlist_items(), pgstat_collect_oids(), PgstatCollectorMain(), plan_cluster_use_sort(), plan_create_index_workers(), plperl_array_to_datum(), plperl_inline_handler(), plperl_return_next(), plperl_return_next_internal(), plperl_spi_commit(), plperl_spi_exec(), plperl_spi_exec_prepared(), plperl_spi_fetchrow(), plperl_spi_prepare(), plperl_spi_query(), plperl_spi_query_prepared(), plperl_spi_rollback(), plperl_util_elog(), plpgsql_compile_inline(), plpgsql_estate_setup(), plpgsql_inline_handler(), plpgsql_validator(), plpython_inline_handler(), pltcl_commit(), pltcl_elog(), pltcl_returnnext(), pltcl_rollback(), pltcl_SPI_execute(), pltcl_SPI_execute_plan(), pltcl_SPI_prepare(), pltcl_subtransaction(), PLy_cursor_fetch(), PLy_cursor_iternext(), PLy_cursor_plan(), PLy_cursor_query(), PLy_output(), PLy_spi_execute_fetch_result(), PLy_spi_execute_plan(), PLy_spi_execute_query(), PLy_spi_prepare(), PLy_subtransaction_enter(), populate_array(), populate_recordset_object_start(), PortalRun(), PortalRunMulti(), postgresAcquireSampleRowsFunc(), postquel_start(), pq_parse_errornotice(), preparePresortedCols(), printtup_startup(), ProcessCompletedNotifies(), prune_append_rel_partitions(), publicationListToArray(), pull_up_simple_subquery(), regexp_split_to_array(), RelationBuildDesc(), RelationBuildRowSecurity(), ReorderBufferAllocate(), ReorderBufferProcessTXN(), ResetUnloggedRelations(), ResetUnloggedRelationsInDbspaceDir(), RevalidateCachedQuery(), ScanKeyEntryInitializeWithInfo(), serialize_expr_stats(), SerializePendingSyncs(), set_relation_partition_info(), set_rtable_names(), SetMessageEncoding(), shm_mq_attach(), spg_xlog_startup(), spgbeginscan(), spgbuild(), spginsert(), spi_dest_startup(), SPI_sql_row_to_xmlelement(), SPI_start_transaction(), split_text_accum_result(), startScanKey(), StartupDecodingContext(), statext_mcv_serialize(), strlist_to_textarray(), sts_attach(), sts_initialize(), subquery_planner(), SysLoggerMain(), tbm_create(), test_enc_conversion(), test_pattern(), text_to_array(), tokenize_file(), transformGraph(), transformRelOptions(), tsquery_rewrite_query(), tuple_data_split_internal(), tuplesort_begin_cluster(), tuplesort_begin_common(), tuplesort_begin_datum(), tuplesort_begin_heap(), tuplesort_begin_index_btree(), tuplesort_begin_index_gist(), tuplestore_begin_common(), union_tuples(), validateForeignKeyConstraint(), WaitLatchOrSocket(), write_console(), xml_is_document(), and xpath().

◆ CurTransactionContext

◆ ErrorContext

MemoryContext ErrorContext = NULL

◆ MessageContext

◆ PortalContext

◆ PostmasterContext

◆ TopMemoryContext

MemoryContext TopMemoryContext = NULL

Definition at line 48 of file mcxt.c.

Referenced by _PG_init(), add_reloption(), allocate_reloption(), AllocateAttribute(), AllocSetContextCreateInternal(), ApplyLauncherMain(), ApplyWorkerMain(), AtAbort_Memory(), AtCleanup_Memory(), AtCommit_Memory(), AtStart_Memory(), AttachSession(), AutoVacLauncherMain(), BackendRun(), BackgroundWriterMain(), be_tls_open_server(), cache_single_string(), check_foreign_key(), check_primary_key(), CheckpointerMain(), CheckSCRAMAuth(), ClientAuthentication(), compile_plperl_function(), compile_pltcl_function(), CreateCacheMemoryContext(), dblink_connect(), dblink_init(), DCH_cache_getnew(), do_autovacuum(), do_compile(), do_start_bgworker(), dsm_create_descriptor(), dsm_impl_sysv(), EnablePortalManager(), EventTriggerBeginCompleteQuery(), Exec_ListenCommit(), executeDateTimeMethod(), find_plan(), finish_xact_command(), GenerationContextCreate(), get_tabstat_entry(), GetLocalBufferStorage(), GetLockConflicts(), GetSessionDsmHandle(), HandleParallelMessages(), hash_create(), init_string_reloption(), InitDeadLockChecking(), initialize_reloptions(), InitializeClientEncoding(), InitializeLatchWaitSet(), InitializeParallelDSM(), InitializeSearchPath(), InitializeSession(), InitSync(), InitXLogInsert(), llvm_compile_module(), llvm_create_context(), llvm_session_initialize(), LockAcquireExtended(), LogicalRepApplyLoop(), LWLockRegisterTranche(), mdinit(), MemoryContextInit(), mxid_to_string(), NUM_cache_getnew(), on_dsm_detach(), PageSetChecksumCopy(), ParallelWorkerMain(), PerformAuthentication(), pg_get_backend_memory_contexts(), pg_newlocale_from_collation(), pg_start_backup(), pgstat_setup_backend_status_context(), pgstat_setup_memcxt(), plperl_spi_prepare(), plpgsql_estate_setup(), plpython_inline_handler(), plsample_func_handler(), pltcl_SPI_prepare(), PLy_cursor_plan(), PLy_cursor_query(), PLy_procedure_create(), PLy_spi_execute_fetch_result(), PLy_spi_prepare(), populate_typ_list(), PostgresMain(), PostmasterMain(), pq_init(), PrepareClientEncoding(), ProcessStartupPacket(), PushOverrideSearchPath(), px_find_cipher(), px_find_digest(), recomputeNamespacePath(), register_label_provider(), RegisterResourceReleaseCallback(), RegisterSubXactCallback(), RegisterXactCallback(), RelationCreateStorage(), RelationDropStorage(), RequestNamedLWLockTranche(), ResourceArrayEnlarge(), ResourceOwnerCreate(), RestoreReindexState(), ri_HashCompareOp(), roles_is_member_of(), secure_open_gssapi(), sepgsql_avc_init(), sepgsql_xact_callback(), set_authn_id(), SetDatabasePath(), SharedRecordTypmodRegistryAttach(), SharedRecordTypmodRegistryInit(), SlabContextCreate(), SPI_connect_ext(), StartChildProcess(), WalWriterMain(), XLOGShmemInit(), and xml_is_document().

◆ TopTransactionContext