PostgreSQL Source Code git master
Loading...
Searching...
No Matches
palloc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  MemoryContextCallback
 

Macros

#define MCXT_ALLOC_HUGE   0x01 /* allow huge allocation (> 1 GB) */
 
#define MCXT_ALLOC_NO_OOM   0x02 /* no failure if out-of-memory */
 
#define MCXT_ALLOC_ZERO   0x04 /* zero allocated memory */
 
#define palloc_object(type)   ((type *) palloc(sizeof(type)))
 
#define palloc0_object(type)   ((type *) palloc0(sizeof(type)))
 
#define palloc_array(type, count)   ((type *) palloc(sizeof(type) * (count)))
 
#define palloc0_array(type, count)   ((type *) palloc0(sizeof(type) * (count)))
 
#define repalloc_array(pointer, type, count)   ((type *) repalloc(pointer, sizeof(type) * (count)))
 
#define repalloc0_array(pointer, type, oldcount, count)   ((type *) repalloc0(pointer, sizeof(type) * (oldcount), sizeof(type) * (count)))
 

Typedefs

typedef struct MemoryContextDataMemoryContext
 
typedef void(* MemoryContextCallbackFunction) (void *arg)
 
typedef struct MemoryContextCallback MemoryContextCallback
 

Functions

voidMemoryContextAlloc (MemoryContext context, Size size)
 
voidMemoryContextAllocZero (MemoryContext context, Size size)
 
voidMemoryContextAllocExtended (MemoryContext context, Size size, int flags)
 
voidMemoryContextAllocAligned (MemoryContext context, Size size, Size alignto, int flags)
 
voidpalloc (Size size)
 
voidpalloc0 (Size size)
 
voidpalloc_extended (Size size, int flags)
 
voidpalloc_aligned (Size size, Size alignto, int flags)
 
pg_nodiscard voidrepalloc (void *pointer, Size size)
 
pg_nodiscard voidrepalloc_extended (void *pointer, Size size, int flags)
 
pg_nodiscard voidrepalloc0 (void *pointer, Size oldsize, Size size)
 
void pfree (void *pointer)
 
voidMemoryContextAllocHuge (MemoryContext context, Size size)
 
pg_nodiscard voidrepalloc_huge (void *pointer, Size size)
 
static MemoryContext MemoryContextSwitchTo (MemoryContext context)
 
void MemoryContextRegisterResetCallback (MemoryContext context, MemoryContextCallback *cb)
 
void MemoryContextUnregisterResetCallback (MemoryContext context, MemoryContextCallback *cb)
 
charMemoryContextStrdup (MemoryContext context, const char *string)
 
charpstrdup (const char *in)
 
charpnstrdup (const char *in, Size len)
 
charpchomp (const char *in)
 
charpsprintf (const char *fmt,...) pg_attribute_printf(1
 
char size_t pvsnprintf (char *buf, size_t len, const char *fmt, va_list args) pg_attribute_printf(3
 

Variables

PGDLLIMPORT MemoryContext CurrentMemoryContext
 

Macro Definition Documentation

◆ MCXT_ALLOC_HUGE

#define MCXT_ALLOC_HUGE   0x01 /* allow huge allocation (> 1 GB) */

Definition at line 64 of file palloc.h.

◆ MCXT_ALLOC_NO_OOM

#define MCXT_ALLOC_NO_OOM   0x02 /* no failure if out-of-memory */

Definition at line 65 of file palloc.h.

◆ MCXT_ALLOC_ZERO

#define MCXT_ALLOC_ZERO   0x04 /* zero allocated memory */

Definition at line 66 of file palloc.h.

◆ palloc0_array

#define palloc0_array (   type,
  count 
)    ((type *) palloc0(sizeof(type) * (count)))

Definition at line 102 of file palloc.h.

◆ palloc0_object

#define palloc0_object (   type)    ((type *) palloc0(sizeof(type)))

Definition at line 96 of file palloc.h.

◆ palloc_array

#define palloc_array (   type,
  count 
)    ((type *) palloc(sizeof(type) * (count)))

Definition at line 101 of file palloc.h.

◆ palloc_object

#define palloc_object (   type)    ((type *) palloc(sizeof(type)))

Definition at line 95 of file palloc.h.

◆ repalloc0_array

#define repalloc0_array (   pointer,
  type,
  oldcount,
  count 
)    ((type *) repalloc0(pointer, sizeof(type) * (oldcount), sizeof(type) * (count)))

Definition at line 109 of file palloc.h.

◆ repalloc_array

#define repalloc_array (   pointer,
  type,
  count 
)    ((type *) repalloc(pointer, sizeof(type) * (count)))

Definition at line 108 of file palloc.h.

Typedef Documentation

◆ MemoryContext

Definition at line 36 of file palloc.h.

◆ MemoryContextCallback

◆ MemoryContextCallbackFunction

typedef void(* MemoryContextCallbackFunction) (void *arg)

Definition at line 45 of file palloc.h.

Function Documentation

◆ MemoryContextAlloc()

void * MemoryContextAlloc ( MemoryContext  context,
Size  size 
)
extern

Definition at line 1232 of file mcxt.c.

1233{
1234 void *ret;
1235
1236 Assert(MemoryContextIsValid(context));
1238
1239 context->isReset = false;
1240
1241 /*
1242 * For efficiency reasons, we purposefully offload the handling of
1243 * allocation failures to the MemoryContextMethods implementation as this
1244 * allows these checks to be performed only when an actual malloc needs to
1245 * be done to request more memory from the OS. Additionally, not having
1246 * to execute any instructions after this call allows the compiler to use
1247 * the sibling call optimization. If you're considering adding code after
1248 * this call, consider making it the responsibility of the 'alloc'
1249 * function instead.
1250 */
1251 ret = context->methods->alloc(context, size, 0);
1252
1253 VALGRIND_MEMPOOL_ALLOC(context, ret, size);
1254
1255 return ret;
1256}
#define Assert(condition)
Definition c.h:873
#define AssertNotInCriticalSection(context)
Definition mcxt.c:195
#define VALGRIND_MEMPOOL_ALLOC(context, addr, size)
Definition memdebug.h:29
#define MemoryContextIsValid(context)
Definition memnodes.h:145
const MemoryContextMethods * methods
Definition memnodes.h:126
void *(* alloc)(MemoryContext context, Size size, int flags)
Definition memnodes.h:66

References MemoryContextMethods::alloc, Assert, AssertNotInCriticalSection, MemoryContextData::isReset, MemoryContextIsValid, MemoryContextData::methods, and VALGRIND_MEMPOOL_ALLOC.

Referenced by _bt_getroot(), _bt_getrootheight(), _bt_metaversion(), _bt_preprocess_keys(), _fdvec_resize(), _hash_getcachedmetap(), AddInvalidationMessage(), afterTriggerAddEvent(), AfterTriggerBeginSubXact(), AfterTriggerEnlargeQueryState(), allocate_record_info(), array_agg_deserialize(), array_agg_serialize(), array_fill_internal(), array_in(), array_out(), array_position_common(), array_positions(), array_recv(), array_send(), array_to_text_internal(), Async_Notify(), AtSubCommit_childXids(), BackgroundWorkerMain(), 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(), copyScalarSubstructure(), CopySnapshot(), create_drop_transactional_internal(), dblink_init(), deconstruct_expanded_record(), dense_alloc(), domain_state_setup(), dsm_create_descriptor(), dsm_impl_sysv(), enlarge_list(), EventTriggerBeginCompleteQuery(), ExecHashBuildSkewHash(), ExecHashSkewTableInsert(), ExecParallelRetrieveJitInstrumentation(), ExecSetSlotDescriptor(), expand_array(), fetch_array_arg_replace_nulls(), gbt_enum_sortsupport(), get_attribute_options(), get_multirange_io_data(), get_range_io_data(), get_tablespace(), GetComboCommandId(), GetExplainExtensionId(), GetFdwRoutineForRelation(), GetLockConflicts(), GetPlannerExtensionId(), gtrgm_consistent(), gtrgm_distance(), gtrgm_penalty(), hash_create(), hash_record(), hash_record_extended(), hstore_from_record(), hstore_populate_record(), init_execution_state(), initArrayResultAny(), initArrayResultWithSize(), initBloomState(), initialize_reloptions(), InitializeClientEncoding(), InitializeParallelDSM(), InitPgFdwOptions(), InitXLogInsert(), insertStatEntry(), intset_new_internal_node(), intset_new_leaf_node(), inv_open(), libpqsrv_PGresultSetParent(), list_delete_first_n(), list_delete_nth_cell(), llvm_compile_module(), load_domaintype_info(), load_relcache_init_file(), LockAcquireExtended(), logical_rewrite_log_mapping(), lookup_ts_config_cache(), lookup_type_cache(), make_expanded_record_from_exprecord(), make_expanded_record_from_tupdesc(), make_expanded_record_from_typeid(), makeBoolAggState(), MemoryContextStrdup(), mergeruns(), mXactCachePut(), on_dsm_detach(), packGraph(), pg_column_compression(), pg_column_size(), pg_column_toast_chunk_id(), pg_input_is_valid_common(), pg_snapshot_xip(), pg_stat_get_backend_idset(), pgstat_build_snapshot(), pgstat_fetch_entry(), pgstat_get_entry_ref_cached(), pgstat_get_xact_stack_level(), pgstat_init_snapshot_fixed(), pgstat_read_current_status(), plpgsql_create_econtext(), plpgsql_start_datums(), PLy_push_execution_context(), PLy_subtransaction_enter(), PortalSetResultFormat(), pq_init(), PreCommit_Notify(), PrepareClientEncoding(), PrepareSortSupportComparisonShim(), PrepareTempTablespaces(), PushActiveSnapshotWithLevel(), pushJsonbValueScalar(), pushState(), px_find_digest(), queue_listen(), record_cmp(), record_eq(), record_image_cmp(), record_image_eq(), record_in(), record_out(), record_recv(), record_send(), RegisterExprContextCallback(), RegisterExtensionExplainOption(), RegisterResourceReleaseCallback(), RegisterSubXactCallback(), RegisterXactCallback(), RelationBuildRuleLock(), RelationCacheInitialize(), RelationCreateStorage(), RelationDropStorage(), RelationParseRelOptions(), ReorderBufferAllocate(), ReorderBufferAllocChange(), ReorderBufferAllocRelids(), ReorderBufferAllocTupleBuf(), ReorderBufferAllocTXN(), ReorderBufferRestoreChange(), ReorderBufferSerializeReserve(), RequestNamedLWLockTranche(), RestoreSnapshot(), RT_ALLOC_LEAF(), RT_ALLOC_NODE(), setup_background_workers(), shm_mq_receive(), SnapBuildPurgeOlderTxn(), SPI_connect_ext(), SPI_palloc(), sql_compile_callback(), StoreIndexTuple(), sts_read_tuple(), tbm_begin_private_iterate(), test_enc_conversion(), tstoreStartupReceiver(), tts_virtual_materialize(), tuplesort_readtup_alloc(), and xactGetCommittedInvalidationMessages().

◆ MemoryContextAllocAligned()

void * MemoryContextAllocAligned ( MemoryContext  context,
Size  size,
Size  alignto,
int  flags 
)
extern

Definition at line 1482 of file mcxt.c.

1484{
1487 void *unaligned;
1488 void *aligned;
1489
1490 /*
1491 * Restrict alignto to ensure that it can fit into the "value" field of
1492 * the redirection MemoryChunk, and that the distance back to the start of
1493 * the unaligned chunk will fit into the space available for that. This
1494 * isn't a limitation in practice, since it wouldn't make much sense to
1495 * waste that much space.
1496 */
1497 Assert(alignto < (128 * 1024 * 1024));
1498
1499 /* ensure alignto is a power of 2 */
1500 Assert((alignto & (alignto - 1)) == 0);
1501
1502 /*
1503 * If the alignment requirements are less than what we already guarantee
1504 * then just use the standard allocation function.
1505 */
1507 return MemoryContextAllocExtended(context, size, flags);
1508
1509 /*
1510 * We implement aligned pointers by simply allocating enough memory for
1511 * the requested size plus the alignment and an additional "redirection"
1512 * MemoryChunk. This additional MemoryChunk is required for operations
1513 * such as pfree when used on the pointer returned by this function. We
1514 * use this redirection MemoryChunk in order to find the pointer to the
1515 * memory that was returned by the MemoryContextAllocExtended call below.
1516 * We do that by "borrowing" the block offset field and instead of using
1517 * that to find the offset into the owning block, we use it to find the
1518 * original allocated address.
1519 *
1520 * Here we must allocate enough extra memory so that we can still align
1521 * the pointer returned by MemoryContextAllocExtended and also have enough
1522 * space for the redirection MemoryChunk. Since allocations will already
1523 * be at least aligned by MAXIMUM_ALIGNOF, we can subtract that amount
1524 * from the allocation size to save a little memory.
1525 */
1527
1528#ifdef MEMORY_CONTEXT_CHECKING
1529 /* ensure there's space for a sentinel byte */
1530 alloc_size += 1;
1531#endif
1532
1533 /*
1534 * Perform the actual allocation, but do not pass down MCXT_ALLOC_ZERO.
1535 * This ensures that wasted bytes beyond the aligned chunk do not become
1536 * DEFINED.
1537 */
1539 flags & ~MCXT_ALLOC_ZERO);
1540
1541 /* compute the aligned pointer */
1542 aligned = (void *) TYPEALIGN(alignto, (char *) unaligned +
1543 sizeof(MemoryChunk));
1544
1546
1547 /*
1548 * We set the redirect MemoryChunk so that the block offset calculation is
1549 * used to point back to the 'unaligned' allocated chunk. This allows us
1550 * to use MemoryChunkGetBlock() to find the unaligned chunk when we need
1551 * to perform operations such as pfree() and repalloc().
1552 *
1553 * We store 'alignto' in the MemoryChunk's 'value' so that we know what
1554 * the alignment was set to should we ever be asked to realloc this
1555 * pointer.
1556 */
1559
1560 /* double check we produced a correctly aligned pointer */
1561 Assert((void *) TYPEALIGN(alignto, aligned) == aligned);
1562
1563#ifdef MEMORY_CONTEXT_CHECKING
1564 alignedchunk->requested_size = size;
1565 /* set mark to catch clobber of "unused" space */
1566 set_sentinel(aligned, size);
1567#endif
1568
1569 /*
1570 * MemoryContextAllocExtended marked the whole unaligned chunk as a
1571 * vchunk. Undo that, instead making just the aligned chunk be a vchunk.
1572 * This prevents Valgrind from complaining that the vchunk is possibly
1573 * leaked, since only pointers to the aligned chunk will exist.
1574 *
1575 * After these calls, the aligned chunk will be marked UNDEFINED, and all
1576 * the rest of the unaligned chunk (the redirection chunk header, the
1577 * padding bytes before it, and any wasted trailing bytes) will be marked
1578 * NOACCESS, which is what we want.
1579 */
1581 VALGRIND_MEMPOOL_ALLOC(context, aligned, size);
1582
1583 /* Now zero (and make DEFINED) just the aligned chunk, if requested */
1584 if ((flags & MCXT_ALLOC_ZERO) != 0)
1585 MemSetAligned(aligned, 0, size);
1586
1587 return aligned;
1588}
#define TYPEALIGN(ALIGNVAL, LEN)
Definition c.h:819
#define MemSetAligned(start, val, len)
Definition c.h:1043
#define unlikely(x)
Definition c.h:412
size_t Size
Definition c.h:619
#define MCXT_ALLOC_ZERO
Definition fe_memutils.h:30
void * MemoryContextAllocExtended(MemoryContext context, Size size, int flags)
Definition mcxt.c:1289
#define VALGRIND_MEMPOOL_FREE(context, addr)
Definition memdebug.h:30
#define PallocAlignedExtraBytes(alignto)
@ MCTX_ALIGNED_REDIRECT_ID
#define PointerGetMemoryChunk(p)
static void MemoryChunkSetHdrMask(MemoryChunk *chunk, void *block, Size value, MemoryContextMethodID methodid)
static int fb(int x)

References Assert, fb(), MCTX_ALIGNED_REDIRECT_ID, MCXT_ALLOC_ZERO, MemoryChunkSetHdrMask(), MemoryContextAllocExtended(), MemSetAligned, PallocAlignedExtraBytes, PointerGetMemoryChunk, TYPEALIGN, unlikely, VALGRIND_MEMPOOL_ALLOC, and VALGRIND_MEMPOOL_FREE.

Referenced by AlignedAllocRealloc(), GetLocalBufferStorage(), PageSetChecksumCopy(), palloc_aligned(), and smgr_bulk_get_buf().

◆ MemoryContextAllocExtended()

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

Definition at line 1289 of file mcxt.c.

1290{
1291 void *ret;
1292
1293 Assert(MemoryContextIsValid(context));
1295
1296 if (!((flags & MCXT_ALLOC_HUGE) != 0 ? AllocHugeSizeIsValid(size) :
1297 AllocSizeIsValid(size)))
1298 elog(ERROR, "invalid memory alloc request size %zu", size);
1299
1300 context->isReset = false;
1301
1302 ret = context->methods->alloc(context, size, flags);
1303 if (unlikely(ret == NULL))
1304 return NULL;
1305
1306 VALGRIND_MEMPOOL_ALLOC(context, ret, size);
1307
1308 if ((flags & MCXT_ALLOC_ZERO) != 0)
1309 MemSetAligned(ret, 0, size);
1310
1311 return ret;
1312}
#define ERROR
Definition elog.h:39
#define elog(elevel,...)
Definition elog.h:226
#define MCXT_ALLOC_HUGE
Definition fe_memutils.h:28
#define AllocHugeSizeIsValid(size)
Definition memutils.h:49
#define AllocSizeIsValid(size)
Definition memutils.h:42

References MemoryContextMethods::alloc, AllocHugeSizeIsValid, AllocSizeIsValid, Assert, AssertNotInCriticalSection, elog, ERROR, fb(), MemoryContextData::isReset, MCXT_ALLOC_HUGE, MCXT_ALLOC_ZERO, MemoryContextIsValid, MemSetAligned, MemoryContextData::methods, unlikely, and VALGRIND_MEMPOOL_ALLOC.

Referenced by BackgroundWorkerStateChange(), DynaHashAlloc(), guc_malloc(), guc_realloc(), libpqsrv_PQwrap(), MemoryContextAllocAligned(), pagetable_allocate(), and RegisterBackgroundWorker().

◆ MemoryContextAllocHuge()

void * MemoryContextAllocHuge ( MemoryContext  context,
Size  size 
)
extern

Definition at line 1725 of file mcxt.c.

1726{
1727 void *ret;
1728
1729 Assert(MemoryContextIsValid(context));
1731
1732 context->isReset = false;
1733
1734 /*
1735 * For efficiency reasons, we purposefully offload the handling of
1736 * allocation failures to the MemoryContextMethods implementation as this
1737 * allows these checks to be performed only when an actual malloc needs to
1738 * be done to request more memory from the OS. Additionally, not having
1739 * to execute any instructions after this call allows the compiler to use
1740 * the sibling call optimization. If you're considering adding code after
1741 * this call, consider making it the responsibility of the 'alloc'
1742 * function instead.
1743 */
1744 ret = context->methods->alloc(context, size, MCXT_ALLOC_HUGE);
1745
1746 VALGRIND_MEMPOOL_ALLOC(context, ret, size);
1747
1748 return ret;
1749}

References MemoryContextMethods::alloc, Assert, AssertNotInCriticalSection, MemoryContextData::isReset, MCXT_ALLOC_HUGE, MemoryContextIsValid, MemoryContextData::methods, and VALGRIND_MEMPOOL_ALLOC.

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

◆ MemoryContextAllocZero()

void * MemoryContextAllocZero ( MemoryContext  context,
Size  size 
)
extern

Definition at line 1266 of file mcxt.c.

1267{
1268 void *ret;
1269
1270 Assert(MemoryContextIsValid(context));
1272
1273 context->isReset = false;
1274
1275 ret = context->methods->alloc(context, size, 0);
1276
1277 VALGRIND_MEMPOOL_ALLOC(context, ret, size);
1278
1279 MemSetAligned(ret, 0, size);
1280
1281 return ret;
1282}

References MemoryContextMethods::alloc, Assert, AssertNotInCriticalSection, MemoryContextData::isReset, MemoryContextIsValid, MemSetAligned, MemoryContextData::methods, and VALGRIND_MEMPOOL_ALLOC.

Referenced by add_tabstat_xact_level(), AllocateAttribute(), array_set_element_expanded(), array_sort_internal(), AttrDefaultFetch(), cached_function_compile(), CheckNNConstraintFetch(), ClientAuthentication(), create_pg_locale_builtin(), create_pg_locale_icu(), create_pg_locale_libc(), CreatePortal(), CreateWaitEventSet(), DCH_cache_getnew(), ensure_record_cache_typmod_slot_exists(), ExecHashBuildSkewHash(), ExecParallelRetrieveJitInstrumentation(), expandColorTrigrams(), fmgr_security_definer(), gistAllocateNewPageBuffer(), index_form_tuple_context(), init_MultiFuncCall(), init_sql_fcache(), initArrayResultArr(), InitializeSession(), InitWalSender(), InitXLogInsert(), json_populate_type(), jsonb_agg_transfn_worker(), jsonb_object_agg_transfn_worker(), llvm_create_context(), load_relcache_init_file(), LookupOpclassInfo(), make_expanded_record_from_datum(), newLOfd(), NUM_cache_getnew(), pg_decode_begin_prepare_txn(), pg_decode_begin_txn(), pg_decode_stream_start(), pgoutput_begin_txn(), pgstat_prep_pending_entry(), pgstat_register_kind(), 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(), RehashCatCacheLists(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationBuildRowSecurity(), RelationBuildTupleDesc(), RelationInitIndexAccessInfo(), ReorderBufferCopySnap(), ReorderBufferIterTXNInit(), ReorderBufferRestoreChange(), ResourceOwnerCreate(), ResourceOwnerEnlarge(), satisfies_hash_partition(), SearchCatCacheList(), secure_open_gssapi(), SetConstraintStateCreate(), SetPlannerGlobalExtensionState(), SetPlannerInfoExtensionState(), SetRelOptInfoExtensionState(), SnapBuildBuildSnapshot(), SnapBuildRestoreSnapshot(), spgGetCache(), sts_puttuple(), ts_accum(), ts_stat_sql(), and WinGetPartitionLocalMemory().

◆ MemoryContextRegisterResetCallback()

void MemoryContextRegisterResetCallback ( MemoryContext  context,
MemoryContextCallback cb 
)
extern

Definition at line 582 of file mcxt.c.

584{
586
587 /* Push onto head so this will be called before older registrants. */
588 cb->next = context->reset_cbs;
589 context->reset_cbs = cb;
590 /* Mark the context as non-reset (it probably is already). */
591 context->isReset = false;
592}
struct MemoryContextCallback * next
Definition palloc.h:51
MemoryContextCallback * reset_cbs
Definition memnodes.h:133

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

Referenced by expanded_record_fetch_tupdesc(), init_sql_fcache(), InitDomainConstraintRef(), libpqsrv_PGresultSetParent(), libpqsrv_PQwrap(), load_validator_library(), make_expanded_record_from_exprecord(), make_expanded_record_from_tupdesc(), make_expanded_record_from_typeid(), pgoutput_startup(), and PLy_exec_function().

◆ MemoryContextStrdup()

◆ MemoryContextSwitchTo()

static MemoryContext MemoryContextSwitchTo ( MemoryContext  context)
inlinestatic

Definition at line 124 of file palloc.h.

125{
127
128 CurrentMemoryContext = context;
129 return old;
130}
PGDLLIMPORT MemoryContext CurrentMemoryContext
Definition mcxt.c:160

References CurrentMemoryContext, and fb().

Referenced by _brin_parallel_merge(), _bt_preprocess_array_keys(), _bt_skiparray_strat_adjust(), _gin_parallel_merge(), _SPI_commit(), _SPI_execmem(), _SPI_make_plan_non_temp(), _SPI_procmem(), _SPI_rollback(), _SPI_save_plan(), AbortOutOfAnyTransaction(), accumArrayResult(), accumArrayResultArr(), aclexplode(), add_child_join_rel_equivalences(), add_reloption(), advance_transition_function(), advance_windowaggregate(), advance_windowaggregate_base(), afterTriggerCopyBitmap(), allocate_reloption(), AllocateRelationDesc(), AllocateSnapshotBuilder(), analyze_row_processor(), AppendIncrementalManifestData(), apply_handle_delete(), apply_handle_insert(), apply_handle_tuple_routing(), apply_handle_update(), apply_handle_update_internal(), apply_spooled_messages(), ApplyLauncherMain(), array_agg_array_combine(), array_agg_combine(), array_set_element_expanded(), array_unnest(), assign_record_type_typmod(), assign_simple_var(), Async_Notify(), AtAbort_Memory(), AtCleanup_Memory(), AtCommit_Memory(), ATRewriteTable(), AtStart_Memory(), AtSubAbort_Memory(), AtSubCleanup_Memory(), AtSubCommit_Memory(), AtSubStart_Memory(), AttachPartitionEnsureIndexes(), AttachSession(), AutoVacLauncherMain(), autovacuum_do_vac_analyze(), BackendInitialize(), BackendMain(), BackgroundWriterMain(), BaseBackupAddTarget(), begin_heap_rewrite(), begin_replication_step(), BeginCopyFrom(), BeginCopyTo(), blinsert(), BlockRefTableMarkBlockModified(), bloomBuildCallback(), bpchar_sortsupport(), brin_build_desc(), brin_build_empty_tuple(), brin_deform_tuple(), brin_minmax_multi_add_value(), brin_minmax_multi_union(), brin_revmap_data(), bringetbitmap(), brininsert(), brtuple_disk_tupdesc(), bt_check_level_from_leftmost(), bt_multi_page_stats(), bt_page_items_bytea(), bt_page_items_internal(), btbpchar_pattern_sortsupport(), btnamesortsupport(), btree_redo(), bttext_pattern_sortsupport(), bttextsortsupport(), btvacuumpage(), BuildCachedPlan(), BuildEventTriggerCache(), BuildHardcodedDescriptor(), BuildParamLogString(), BuildRelationExtStatistics(), buildSubPlanHash(), BuildTupleHashTable(), bytea_sortsupport(), bytea_string_agg_transfn(), cache_lookup(), cache_store_tuple(), cached_scansel(), cachedNamespacePath(), CatalogCacheCreateEntry(), CatalogCacheInitializeCache(), cfunc_hashtable_insert(), check_default_partition_contents(), check_domain_for_new_field(), check_domain_for_new_tuple(), CheckpointerMain(), CloneRowTriggersToPartition(), compactify_ranges(), compile_plperl_function(), compile_pltcl_function(), CompleteCachedPlan(), compute_array_stats(), compute_distinct_stats(), compute_expr_stats(), compute_index_stats(), compute_range_stats(), compute_scalar_stats(), compute_tsvector_stats(), ComputeExtStatisticsRows(), connectby(), connectby_text(), connectby_text_serial(), convert_prep_stmt_params(), convert_value_to_string(), copy_sequences(), CopyCachedPlan(), CopyFrom(), CopyMultiInsertBufferFlush(), CopyOneRowTo(), copyScalarSubstructure(), create_cursor(), create_join_clause(), create_unique_paths(), CreateCachedPlan(), CreateCachedPlanForQuery(), CreateDecodingContext(), CreateExecutorState(), CreateExprContextInternal(), CreateIncrementalBackupInfo(), CreateInitDecodingContext(), CreateParallelContext(), CreatePartitionDirectory(), createTrgmNFA(), CreateTriggerFiringOn(), crosstab(), crosstab_hash(), daitch_mokotoff(), dblink_get_pkey(), deconstruct_expanded_array(), DiscreteKnapsack(), do_analyze_rel(), do_autovacuum(), do_cast_value(), do_numeric_accum(), do_numeric_discard(), do_start_worker(), domain_check_input(), DoPortalRewind(), dsnowball_lexize(), each_object_field_end(), each_worker_jsonb(), elements_array_element_end(), elements_worker_jsonb(), EmitErrorReport(), ensure_free_space_in_buffer(), errbacktrace(), errcontext_msg(), errdetail(), errdetail_internal(), errdetail_log(), errdetail_log_plural(), errdetail_plural(), errfinish(), errhint(), errhint_internal(), errhint_plural(), errmsg(), errmsg_internal(), errmsg_plural(), eval_windowaggregates(), eval_windowfunction(), EvalOrderByExpressions(), EvalPlanQualEnd(), EvalPlanQualNext(), EvalPlanQualSlot(), EvalPlanQualStart(), evaluate_expr(), EventTriggerAlterTableEnd(), EventTriggerAlterTableStart(), EventTriggerCollectAlterDefPrivs(), EventTriggerCollectAlterOpFam(), EventTriggerCollectAlterTableSubcmd(), EventTriggerCollectAlterTSConfig(), EventTriggerCollectCreateOpClass(), EventTriggerCollectGrant(), EventTriggerCollectSimpleCommand(), EventTriggerInvoke(), EventTriggerSQLDropAddObject(), exec_assign_c_string(), exec_bind_message(), exec_describe_portal_message(), exec_describe_statement_message(), exec_eval_datum(), exec_eval_simple_expr(), exec_eval_using_params(), exec_init_tuple_store(), exec_move_row_from_datum(), exec_parse_message(), exec_replication_command(), exec_simple_check_plan(), exec_simple_query(), exec_stmt_block(), exec_stmt_close(), exec_stmt_fetch(), exec_stmt_forc(), exec_stmt_foreach_a(), exec_stmt_getdiag(), exec_stmt_open(), exec_stmt_raise(), exec_stmt_return_next(), exec_stmt_return_query(), ExecAggCopyTransValue(), ExecAggInitGroup(), ExecAggPlainTransByRef(), ExecAggPlainTransByVal(), ExecCallTriggerFunc(), ExecComputeStoredGenerated(), ExecCrossPartitionUpdate(), ExecEvalConvertRowtype(), ExecEvalExprNoReturnSwitchContext(), ExecEvalExprSwitchContext(), ExecEvalHashedScalarArrayOp(), ExecEvalPreOrderedDistinctSingle(), ExecEvalWholeRowVar(), ExecFindMatchingSubPlans(), ExecFindPartition(), ExecForceStoreHeapTuple(), ExecGetAllNullSlot(), ExecGetAllUpdatedCols(), ExecGetReturningSlot(), ExecGetRootToChildMap(), ExecGetTriggerNewSlot(), ExecGetTriggerOldSlot(), ExecGetTriggerResultRel(), ExecHashIncreaseNumBatches(), ExecHashJoinSaveTuple(), ExecHashTableCreate(), ExecHashTableReset(), ExecIndexEvalArrayKeys(), ExecIndexEvalRuntimeKeys(), ExecInitGenerated(), ExecInitPartitionDispatchInfo(), ExecInitPartitionInfo(), ExecInitRoutingInfo(), ExecInsert(), ExecInterpExpr(), ExecMakeFunctionResultSet(), ExecMakeTableFunctionResult(), ExecParallelHashEnsureBatchAccessors(), ExecParallelHashJoinSetUpBatches(), ExecParallelRetrieveInstrumentation(), ExecPartitionCheck(), ExecPrepareCheck(), ExecPrepareExpr(), ExecPrepareExprList(), ExecPrepareQual(), ExecPrepareTuplestoreResult(), ExecProjectSRF(), ExecRelCheck(), ExecRelGenVirtualNotNull(), ExecScanSubPlan(), ExecSetParamPlan(), execTuplesUnequal(), execute_sql_string(), executeDateTimeMethod(), ExecutorRewind(), ExecVacuum(), expand_array(), expand_vacuum_rel(), expanded_record_set_field_internal(), expanded_record_set_fields(), expanded_record_set_tuple(), explain_ExecutorEnd(), explain_ExecutorStart(), ExplainExecuteQuery(), ExportSnapshot(), fetch_array_arg_replace_nulls(), fetch_more_data(), FetchRelationStates(), file_acquire_sample_rows(), fileIterateForeignScan(), fill_hba_view(), fill_ident_view(), finalize_aggregate(), finalize_partialaggregate(), finalize_windowaggregate(), FinalizeIncrementalManifest(), find_plan(), FindTupleHashEntry(), fmgr_security_definer(), ForeignNext(), format_elog_string(), format_expr_params(), format_preparedparamsdata(), generate_partition_qual(), generate_series_step_int4(), generate_series_step_int8(), generate_series_step_numeric(), generate_series_timestamp(), generate_series_timestamptz_internal(), generate_subscripts(), geqo_eval(), get_actual_variable_endpoint(), get_actual_variable_range(), get_all_vacuum_rels(), get_cast_hashentry(), get_database_list(), get_eclass_for_sort_expr(), get_qual_for_range(), get_record_type_from_query(), get_rel_sync_entry(), get_subscription_list(), get_tables_to_cluster(), get_tables_to_cluster_partitioned(), GetAfterTriggersStoreSlot(), GetAfterTriggersTableData(), GetCachedExpression(), GetConnection(), GetCurrentFDWTuplestore(), getmissingattr(), GetNamedDSA(), GetNamedDSHash(), GetNamedDSMSegment(), GetSearchPathMatcher(), GetSessionDsmHandle(), GetWALRecordsInfo(), GetXLogSummaryStats(), gin_check_parent_keys_consistency(), gin_check_posting_tree_parent_keys_consistency(), gin_leafpage_items(), gin_redo(), ginbuild(), ginBuildCallback(), ginBuildCallbackParallel(), ginHeapTupleBulkInsert(), gininsert(), ginInsertCleanup(), ginNewScanKey(), ginPlaceToPage(), ginVacuumPostingTreeLeaves(), gist_indexsortbuild_levelstate_flush(), gist_redo(), gistbeginscan(), gistbuild(), gistBuildCallback(), gistEmptyAllBuffers(), gistFetchTuple(), gistGetNodeBuffer(), gistgettuple(), gistinsert(), gistPushItupToNodeBuffer(), gistrescan(), gistScanPage(), gistSortedBuildCallback(), gistvacuumscan(), grow_notnull_info(), hash_array(), hash_page_items(), heap_page_items(), hypothetical_dense_rank_final(), index_getprocinfo(), index_register(), init_execution_state(), init_sexpr(), init_tuple_slot(), InitCatCache(), InitDeadLockChecking(), initGISTstate(), initGlobalChannelTable(), initialize_aggregate(), initialize_brin_insertstate(), initialize_target_list(), initialize_windowaggregate(), InitializeLogRepWorker(), InitializeParallelDSM(), InitializeSearchPath(), InitIndexAmRoutine(), InitMaterializedSRF(), initTrie(), injection_points_attach(), injection_points_detach(), inline_function(), inline_function_in_from(), innerrel_is_unique_ext(), int8_avg_combine(), json_agg_transfn_worker(), json_object_agg_transfn_worker(), json_object_keys(), json_unique_builder_get_throwawaybuf(), jsonb_object_keys(), jsonb_path_query_internal(), JsonTablePlanScanNextRow(), JsonTableResetRowPattern(), keyGetItem(), LaunchParallelWorkers(), libpqrcv_processTuples(), llvm_compile_module(), llvm_session_initialize(), load_categories_hash(), load_domaintype_info(), load_enum_cache_data(), load_hba(), load_ident(), load_tzoffsets(), LogicalParallelApplyLoop(), logicalrep_launcher_attach_dshmem(), logicalrep_partition_open(), logicalrep_rel_open(), logicalrep_relmap_update(), LogicalRepApplyLoop(), LogicalRepSyncSequences(), LogicalRepWorkersWakeupAtCommit(), lookup_ts_dictionary_cache(), LookupTupleHashEntry(), LookupTupleHashEntry_internal(), LookupTupleHashEntryHash(), lowerstr_ctx(), macaddr_sortsupport(), make_callstmt_target(), make_canonical_pathkey(), make_datum_param(), make_expanded_record_from_datum(), make_expanded_record_from_exprecord(), make_expanded_record_from_tupdesc(), make_tuple_from_result_row(), make_tuple_indirect(), makeArrayResultArr(), makeInt128AggState(), makeIntervalAggState(), makeMdArrayResult(), makeNumericAggState(), makeStringAggState(), MakeTransitionCaptureState(), mark_dummy_rel(), MarkGUCPrefixReserved(), materializeQueryResult(), materializeResult(), maybe_reread_subscription(), MemoizeHash_equal(), MemoizeHash_hash(), MergePartitionsMoveRows(), MJCompare(), MJEvalInnerValues(), MJEvalOuterValues(), multirange_minus_multi(), multirange_unnest(), network_sortsupport(), next_field_expand(), normal_rand(), numeric_avg_combine(), numeric_combine(), numeric_poly_combine(), numeric_sortsupport(), operator_predicate_proof(), ordered_set_startup(), pa_launch_parallel_worker(), pa_start_subtrans(), perform_work_item(), PerformCursorOpen(), PersistHoldablePortal(), pg_backup_start(), pg_buffercache_os_pages_internal(), pg_buffercache_pages(), pg_check_frozen(), pg_check_visible(), pg_decode_change(), pg_decode_truncate(), pg_get_catalog_foreign_keys(), pg_get_dsm_registry_allocations(), pg_get_keywords(), pg_get_multixact_members(), pg_get_publication_sequences(), pg_get_publication_tables(), pg_get_wal_block_info(), pg_listening_channels(), pg_lock_status(), pg_logical_slot_get_changes_guts(), pg_partition_ancestors(), pg_partition_tree(), pg_prepared_xact(), pg_stats_ext_mcvlist_items(), pg_timezone_abbrevs_abbrevs(), pg_timezone_abbrevs_zone(), pg_visibility_map_rel(), pg_visibility_rel(), pgarch_archiveXlog(), pgoutput_change(), pgoutput_column_list_init(), pgoutput_row_filter_init(), pgoutput_truncate(), pgp_armor_headers(), pgss_ExecutorStart(), pgstat_attach_shmem(), 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_callback(), plpgsql_compile_inline(), plpgsql_create_econtext(), plpgsql_exec_function(), plpgsql_fulfill_promise(), plpgsql_parse_cwordrowtype(), plpgsql_parse_cwordtype(), plpgsql_parse_wordrowtype(), pltcl_commit(), pltcl_elog(), pltcl_func_handler(), pltcl_init_tuple_store(), pltcl_rollback(), pltcl_SPI_prepare(), pltcl_subtrans_abort(), pltcl_subtrans_begin(), pltcl_subtrans_commit(), pltcl_subtransaction(), PLy_abort_open_subtransactions(), PLy_commit(), PLy_cursor_plan(), PLy_input_convert(), PLy_input_from_tuple(), PLy_output(), PLy_procedure_create(), PLy_rollback(), PLy_spi_execute_fetch_result(), PLy_spi_execute_plan(), PLy_spi_prepare(), PLy_spi_subtransaction_abort(), PLy_spi_subtransaction_begin(), PLy_spi_subtransaction_commit(), PLy_subtransaction_enter(), PLy_subtransaction_exit(), PopTransaction(), populate_recordset_worker(), populate_typ_list(), PortalCreateHoldStore(), PortalDrop(), PortalRun(), PortalRunFetch(), PortalRunUtility(), PortalStart(), PostgresMain(), postmaster_child_launch(), PostmasterMain(), postquel_end(), postquel_getnext(), postquel_start(), postquel_sub_params(), prep_domain_constraints(), prepare_next_query(), prepare_probe_slot(), PrepareClientEncoding(), PrepareForIncrementalBackup(), printtup(), process_ordered_aggregate_single(), ProcessConfigFile(), ProcessParallelApplyMessages(), ProcessParallelMessages(), ProcessStartupPacket(), prs_setup_firstcall(), pub_collist_to_bitmapset(), publicationListToArray(), queue_listen(), range_minus_multi(), RE_compile_and_cache(), rebuild_database_list(), recomputeNamespacePath(), regexp_matches(), regexp_split_to_table(), register_label_provider(), register_on_commit_action(), ReindexMultipleTables(), ReindexPartitions(), ReindexRelationConcurrently(), ReinitializeParallelDSM(), relation_has_unique_index_for(), RelationBuildDesc(), RelationBuildLocalRelation(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationBuildPublicationDesc(), RelationBuildRowSecurity(), RelationBuildRuleLock(), RelationBuildTriggers(), RelationBuildTupleDesc(), RelationCacheInitializePhase2(), RelationCacheInitializePhase3(), RelationGetExclusionInfo(), RelationGetFKeyList(), RelationGetIdentityKeyBitmap(), RelationGetIndexAttOptions(), RelationGetIndexAttrBitmap(), RelationGetIndexExpressions(), RelationGetIndexList(), RelationGetIndexPredicate(), RelationGetStatExtList(), RelationInitIndexAccessInfo(), ReleaseCurrentSubTransaction(), RememberSyncRequest(), RememberToFreeTupleDescAtEOX(), ReorderBufferAddDistributedInvalidations(), ReorderBufferAddInvalidations(), ReorderBufferImmediateInvalidation(), ReorderBufferProcessTXN(), ReorderBufferQueueMessage(), ReorderBufferToastReplace(), reorderqueue_push(), reparameterize_path_by_child(), request_publisher_status(), resetSpGistScanOpaque(), ResetUnloggedRelations(), RestoreReindexState(), ReThrowError(), RevalidateCachedQuery(), rewrite_heap_tuple(), roles_is_member_of(), RunFromStore(), scanPendingInsert(), SearchCatCacheList(), send_feedback(), sepgsql_avc_compute(), sepgsql_fmgr_hook(), sepgsql_set_client_label(), serializeAnalyzeReceive(), set_schema_sent_in_streamed_txn(), setup_background_workers(), setup_firstcall(), SharedRecordTypmodRegistryAttach(), SharedRecordTypmodRegistryInit(), shdepReassignOwned(), show_all_settings(), ShutdownExprContext(), SnapBuildSerialize(), spg_box_quad_inner_consistent(), spg_kd_inner_consistent(), spg_quad_inner_consistent(), spg_range_quad_inner_consistent(), spg_redo(), spgInnerTest(), spginsert(), spgistBuildCallback(), spgLeafTest(), SPI_connect_ext(), SPI_copytuple(), SPI_cursor_open_internal(), SPI_datumTransfer(), spi_dest_startup(), SPI_finish(), SPI_modifytuple(), spi_printtup(), SPI_returntuple(), SplitPartitionMoveRows(), spool_tuples(), sql_compile_callback(), ssl_extension_info(), standard_ExecutorEnd(), standard_ExecutorFinish(), standard_ExecutorRun(), standard_ExecutorStart(), standard_ExplainOneQuery(), startScanKey(), StartTransactionCommand(), StartupDecodingContext(), statext_dependencies_build(), store_flush_position(), storeRow(), stream_open_file(), stream_start_internal(), string_agg_combine(), strlist_to_textarray(), sts_parallel_scan_next(), sts_puttuple(), subxact_info_add(), subxact_info_read(), test_create(), test_custom_stats_var_report(), test_pattern(), test_regex(), tfuncFetchRows(), tfuncLoadRows(), ThrowErrorData(), tokenize_auth_file(), tokenize_expand_file(), TriggerEnabled(), ts_setup_firstcall(), tsquery_rewrite_query(), tstoreReceiveSlot_detoast(), tsvector_unnest(), tt_setup_firstcall(), tts_buffer_heap_copyslot(), tts_buffer_heap_materialize(), tts_heap_copyslot(), tts_heap_materialize(), tts_minimal_copyslot(), tts_minimal_materialize(), TupleHashTableHash(), tuplesort_begin_batch(), tuplesort_begin_cluster(), tuplesort_begin_common(), tuplesort_begin_datum(), tuplesort_begin_heap(), tuplesort_begin_index_btree(), tuplesort_begin_index_gin(), tuplesort_begin_index_gist(), tuplesort_begin_index_hash(), tuplesort_free(), tuplesort_getbrintuple(), tuplesort_getdatum(), tuplesort_getgintuple(), tuplesort_getheaptuple(), tuplesort_getindextuple(), tuplesort_gettupleslot(), tuplesort_markpos(), tuplesort_performsort(), tuplesort_putbrintuple(), tuplesort_putdatum(), tuplesort_putgintuple(), tuplesort_putheaptuple(), tuplesort_puttuple_common(), tuplesort_puttupleslot(), tuplesort_rescan(), tuplesort_restorepos(), tuplesort_skiptuples(), tuplestore_puttuple(), tuplestore_puttuple_common(), tuplestore_puttupleslot(), tuplestore_putvalues(), union_tuples(), update_cached_tupdesc(), update_frameheadpos(), update_frametailpos(), update_grouptailpos(), uuid_sortsupport(), vacuum(), validateForeignKeyConstraint(), ValuesNext(), WalSummarizerMain(), WalWriterMain(), window_gettupleslot(), and XLogInsertRecord().

◆ MemoryContextUnregisterResetCallback()

void MemoryContextUnregisterResetCallback ( MemoryContext  context,
MemoryContextCallback cb 
)
extern

Definition at line 607 of file mcxt.c.

609{
611 *cur;
612
614
615 for (prev = NULL, cur = context->reset_cbs; cur != NULL;
616 prev = cur, cur = cur->next)
617 {
618 if (cur != cb)
619 continue;
620 if (prev)
621 prev->next = cur->next;
622 else
623 context->reset_cbs = cur->next;
624 return;
625 }
626 Assert(false);
627}
struct cursor * cur
Definition ecpg.c:29
struct cursor * next
Definition type.h:148

References Assert, cur, fb(), MemoryContextIsValid, MemoryContextCallback::next, cursor::next, and MemoryContextData::reset_cbs.

Referenced by libpqsrv_PGresultSetParent(), and libpqsrv_PQclear().

◆ palloc()

void * palloc ( Size  size)
extern

Definition at line 1387 of file mcxt.c.

1388{
1389 /* duplicates MemoryContextAlloc to avoid increased overhead */
1390 void *ret;
1392
1393 Assert(MemoryContextIsValid(context));
1395
1396 context->isReset = false;
1397
1398 /*
1399 * For efficiency reasons, we purposefully offload the handling of
1400 * allocation failures to the MemoryContextMethods implementation as this
1401 * allows these checks to be performed only when an actual malloc needs to
1402 * be done to request more memory from the OS. Additionally, not having
1403 * to execute any instructions after this call allows the compiler to use
1404 * the sibling call optimization. If you're considering adding code after
1405 * this call, consider making it the responsibility of the 'alloc'
1406 * function instead.
1407 */
1408 ret = context->methods->alloc(context, size, 0);
1409 /* We expect OOM to be handled by the alloc function */
1410 Assert(ret != NULL);
1411 VALGRIND_MEMPOOL_ALLOC(context, ret, size);
1412
1413 return ret;
1414}
MemoryContext CurrentMemoryContext
Definition mcxt.c:160

References MemoryContextMethods::alloc, Assert, AssertNotInCriticalSection, CurrentMemoryContext, fb(), MemoryContextData::isReset, MemoryContextIsValid, MemoryContextData::methods, pg_malloc_internal(), and VALGRIND_MEMPOOL_ALLOC.

Referenced by _bt_bottomupdel_pass(), _bt_dedup_pass(), _bt_delitems_delete_check(), _bt_delitems_update(), _bt_load(), _bt_mkscankey(), _bt_newlevel(), _bt_preprocess_array_keys(), _bt_simpledel_pass(), _bt_unmark_keys(), _intbig_alloc(), _ltree_picksplit(), _metaphone(), AbsorbSyncRequests(), accum_sum_copy(), accumArrayResultArr(), aclitemout(), aclmembers(), acquire_inherited_sample_rows(), add_exact_object_address_extra(), add_reloption(), addWrd(), adjust_appendrel_attrs_mutator(), allocate_recordbuf(), allocate_reloption(), AllocateRelationDesc(), AlterSubscription_refresh(), anybit_typmodout(), anychar_typmodout(), appendJSONKeyValueFmt(), AppendStringCommandOption(), apply_spooled_messages(), array_agg_array_combine(), array_agg_array_deserialize(), array_create_iterator(), array_map(), array_out(), array_recv(), array_replace_internal(), array_set_element(), ArrayGetIntegerTypmods(), Async_Notify(), autoinc(), bbsink_copystream_begin_backup(), be_loread(), be_tls_get_certificate_hash(), 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(), bms_copy(), boolout(), bottomup_sort_and_shrink(), box_poly(), bpchar(), bpchar_input(), bqarr_in(), brin_build_desc(), brin_copy_tuple(), brin_minmax_multi_distance_inet(), brin_page_items(), brin_range_deserialize(), brin_revmap_data(), bringetbitmap(), bt_normalize_tuple(), bt_page_items_internal(), bt_page_print_tuples(), btbeginscan(), btree_xlog_dedup(), btree_xlog_updates(), btreevacuumposting(), btrescan(), BufferSync(), build_column_frequencies(), build_distinct_groups(), build_function_result_tupdesc_d(), build_mvndistinct(), build_pertrans_for_aggref(), build_server_final_message(), build_server_first_message(), build_tlist_index(), build_tlist_index_other_vars(), build_tuplestore_recursively(), BuildTupleFromCStrings(), bytea_catenate(), bytea_reverse(), bytea_string_agg_finalfn(), byteain(), byteaout(), bytearecv(), calc_word_similarity(), CatalogCacheCreateEntry(), catenate_stringinfo_string(), char_bpchar(), char_text(), charout(), check_foreign_key(), check_ident_usermap(), check_primary_key(), check_temp_tablespaces(), checkSharedDependencies(), chr(), cidout(), cleanup_tsquery_stopwords(), collect_corrupt_items(), collectTSQueryValues(), compute_array_stats(), compute_distinct_stats(), compute_expr_stats(), compute_index_stats(), compute_range_stats(), compute_scalar_stats(), compute_tsvector_stats(), computeLeafRecompressWALData(), concat_text(), connect_pg_server(), consider_groupingsets_paths(), convert_prep_stmt_params(), convert_requires_to_datum(), convert_string_datum(), copy_file(), copy_pathtarget(), copy_plpgsql_datums(), CopyFromTextLikeStart(), CopyIndexTuple(), CopyLimitPrintoutLength(), copytext(), CopyTriggerDesc(), core_yyalloc(), core_yyrealloc(), count_usable_fds(), create_hash_bounds(), create_limit_plan(), create_list_bounds(), create_memoize_plan(), create_mergejoin_plan(), create_range_bounds(), create_secmsg(), CreateConstraintEntry(), CreateFunction(), CreatePartitionPruneState(), createPostingTree(), CreateTemplateTupleDesc(), CreateTriggerFiringOn(), CreateTupleDescCopyConstr(), cstring_to_text_with_len(), cube_recv(), current_database(), current_schemas(), dataBeginPlaceToPageLeaf(), datetime_format_has_tz(), datetime_to_char_body(), datumCopy(), datumRestore(), datumSerialize(), debackslash(), decodePageSplitRecord(), DeescapeQuotedString(), deparse_lquery(), deparse_ltree(), deserialize_deflist(), detoast_attr(), detoast_attr_slice(), detoast_external_attr(), disassembleLeaf(), DiscreteKnapsack(), div_var(), do_analyze_rel(), do_to_timestamp(), dobyteatrim(), DoCopyTo(), doPickSplit(), dotrim(), double_to_shortest_decimal(), downcase_convert(), downcase_identifier(), DropRelationsAllBuffers(), duplicate_numeric(), encrypt_password(), entry_dealloc(), enum_range_internal(), ExecAggRetrieveInstrumentation(), ExecBitmapHeapRetrieveInstrumentation(), ExecBitmapIndexScanRetrieveInstrumentation(), ExecEvalArrayExpr(), ExecGather(), ExecGatherMerge(), ExecGetJsonValueItemString(), ExecHashJoinGetSavedTuple(), ExecHashRetrieveInstrumentation(), ExecIncrementalSortRetrieveInstrumentation(), ExecIndexBuildScanKeys(), ExecIndexOnlyScanRetrieveInstrumentation(), ExecIndexScanRetrieveInstrumentation(), ExecInitAgg(), ExecInitAppend(), ExecInitExprRec(), ExecInitIndexScan(), ExecInitJunkFilter(), ExecInitMemoize(), ExecInitPartitionDispatchInfo(), ExecInitSubPlan(), ExecInitValuesScan(), ExecMakeTableFunctionResult(), ExecMemoizeRetrieveInstrumentation(), ExecParallelCreateReaders(), ExecParallelRetrieveInstrumentation(), ExecParallelSetupTupleQueues(), ExecSortRetrieveInstrumentation(), execTuplesHashPrepare(), execTuplesMatchPrepare(), ExecuteTruncateGuts(), ExplainCreateWorkersState(), extract_rollup_sets(), fallbackSplit(), file_acquire_sample_rows(), find_hash_columns(), find_in_path(), find_inheritance_children_extended(), FinishWalRecovery(), float4_to_char(), float4out(), float8_to_char(), float8out_internal(), float_to_shortest_decimal(), format_operator_extended(), format_procedure_extended(), formTextDatum(), formTextDatum(), FuncnameGetCandidates(), g_cube_picksplit(), g_int_picksplit(), g_intbig_picksplit(), gbt_bit_xfrm(), gbt_bool_union(), gbt_cash_union(), gbt_date_union(), gbt_enum_union(), gbt_float4_union(), gbt_float8_union(), gbt_inet_union(), gbt_int2_union(), gbt_int4_union(), gbt_int8_union(), gbt_intv_compress(), gbt_intv_union(), gbt_num_picksplit(), gbt_oid_union(), gbt_time_union(), gbt_ts_union(), gbt_uuid_compress(), gbt_uuid_union(), gbt_var_key_from_datum(), gbt_var_picksplit(), gen_random_uuid(), generate_normalized_query(), generate_restrict_key(), generate_trgm(), generate_trgm_only(), generate_uuidv7(), generate_wildcard_trgm(), generateHeadline(), genericPickSplit(), get_attribute_options(), get_environ(), get_extension_aux_control_filename(), get_extension_control_directories(), get_extension_script_filename(), get_func_arg_info(), get_func_input_arg_names(), get_func_signature(), get_func_trftypes(), get_name_for_var_field(), get_page_from_raw(), get_permutation(), get_raw_page_internal(), get_str_from_var(), get_str_from_var_sci(), get_tsearch_config_filename(), get_val(), GetMultiXactIdMembers(), GetPermutation(), GetRunningTransactionLocks(), GetWALBlockInfo(), ghstore_alloc(), ghstore_picksplit(), gin_extract_hstore(), gin_extract_hstore_query(), gin_leafpage_items(), GinBufferStoreTuple(), ginCompressPostingList(), GinDataLeafPageGetItems(), GinFormInteriorTuple(), ginHeapTupleFastInsert(), ginMergeItemPointers(), ginNewScanKey(), ginPostingListDecodeAllSegments(), ginReadTuple(), ginReadTupleWithoutState(), ginRedoRecompress(), ginVacuumPostingTreeLeaf(), gist_box_picksplit(), gist_indexsortbuild(), gist_indexsortbuild_levelstate_flush(), gist_page_items_bytea(), gistbeginscan(), gistfillitupvec(), gistGetItupFromPage(), gistgettuple(), gistMakeUnionItVec(), gistrescan(), gistScanPage(), gistSplitByKey(), gistSplitHalf(), gseg_picksplit(), gtrgm_alloc(), gtrgm_consistent(), gtrgm_picksplit(), gtsquery_picksplit(), gtsvector_alloc(), gtsvector_penalty(), gtsvector_picksplit(), hash_object_field_end(), hashagg_batch_read(), hashbpchar(), hashbpcharextended(), hashtext(), hashtextextended(), heap_copy_minimal_tuple(), heap_copy_tuple_as_datum(), heap_copytuple(), heap_copytuple_with_tuple(), heap_multi_insert(), heap_page_items(), heap_tuple_from_minimal_tuple(), 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(), icu_language_tag(), ImportSnapshot(), inet_gist_picksplit(), inet_set_masklen(), init_sexpr(), init_slab_allocator(), init_tsvector_parser(), InitDeadLockChecking(), InitJumble(), InitPostmasterChildSlots(), initStringInfoInternal(), InitWalRecovery(), inplaceGetInvalidationMessages(), int2out(), int2vectorout(), int44in(), int44out(), int4_to_char(), int4out(), int8_to_char(), int8out(), int_to_roman(), interpret_AS_clause(), interpret_function_parameter_list(), intervaltypmodout(), irbt_alloc(), json_manifest_finalize_file(), jsonb_object_keys(), JsonbValueToJsonb(), JsonEncodeDateTime(), jsonpath_yyalloc(), jsonpath_yyrealloc(), leafRepackItems(), libpqrcv_readtimelinehistoryfile(), like_fixed_prefix(), like_fixed_prefix_ci(), litbufdup(), llvm_compile_expr(), lo_get_fragment_internal(), load_domaintype_info(), load_enum_cache_data(), load_relcache_init_file(), logfile_getname(), logical_heap_rewrite_flush_mappings(), logicalrep_read_tuple(), LogicalRepSyncTableStart(), LogicalTapeFreeze(), LogicalTapeSetCreate(), LogicalTapeWrite(), lookup_var_attr_stats(), lpad(), lrq_alloc(), ltree2text(), ltree_gist_alloc(), ltree_picksplit(), ltree_prefix_eq_ci(), ltsInitReadBuffer(), lz4_compress_datum(), lz4_decompress_datum(), lz4_decompress_datum_slice(), macaddr8_out(), macaddr_out(), make_build_data(), make_colname_unique(), make_greater_string(), make_jsp_entry_node(), make_jsp_expr_node(), make_partitionedrel_pruneinfo(), make_pathtarget_from_tlist(), make_result_safe(), make_sort_from_groupcols(), make_sort_from_sortclauses(), make_text_key(), make_tuple_from_result_row(), make_tuple_indirect(), makeitem(), makeObjectName(), makeParamList(), mark_hl_fragments(), MatchNamedCall(), MatchText(), mbuf_create(), minimal_tuple_from_heap_tuple(), mock_scram_secret(), moveLeafs(), mul_var(), mXactCacheGetById(), new_list(), newLexeme(), nodeRead(), NUM_cache(), numeric_sortsupport(), numeric_to_char(), numeric_to_number(), numerictypmodout(), oid8out(), oidout(), oidvectorout(), oidvectortypes(), OpernameGetCandidates(), optionListToArray(), order_qual_clauses(), ordered_set_startup(), pad_eme_pkcs1_v15(), PageGetTempPage(), PageGetTempPageCopy(), PageGetTempPageCopySpecial(), palloc_btree_page(), parse_compress_specification(), parse_fcall_arguments(), parse_one_reloption(), parse_scram_secret(), parse_tsquery(), ParseLongOption(), parseRelOptions(), partition_bounds_copy(), path_add(), path_in(), path_poly(), path_recv(), percentile_cont_multi_final_common(), percentile_disc_multi_final(), PerformRadiusTransaction(), pg_armor(), pg_blocking_pids(), 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_constraintdef_worker(), pg_get_logical_snapshot_info(), pg_get_userbyid(), pg_hmac(), pg_import_system_collations(), pg_listening_channels(), pg_random_bytes(), pg_safe_snapshot_blocking_pids(), pg_snapshot_recv(), pglz_compress_datum(), pglz_decompress_datum(), pglz_decompress_datum_slice(), pgp_extract_armor_headers(), pgp_key_id_w(), pgp_mpi_alloc(), pgrowlocks(), pgss_shmem_startup(), pgstat_fetch_entry(), pgstat_get_transactional_drops(), placeChar(), plaintree(), plperl_spi_exec_prepared(), plperl_spi_prepare(), plperl_spi_query_prepared(), plperl_to_hstore(), plpgsql_ns_additem(), plpython_to_hstore(), pltcl_quote(), pltcl_SPI_execute_plan(), pltcl_SPI_prepare(), PLy_cursor_plan(), PLy_procedure_munge_source(), PLy_spi_execute_plan(), PLyObject_ToBytea(), pnstrdup(), policy_role_list_to_array(), poly_path(), populate_record(), populate_recordset_object_field_end(), populate_scalar(), PostmasterMain(), pq_getmsgtext(), prepare_sort_from_pathkeys(), prepare_sql_fn_parse_info(), preparePresortedCols(), preprocess_grouping_sets(), PrescanPreparedTransactions(), ProcessStartupPacket(), prs_setup_firstcall(), psprintf(), pullf_create(), pushf_create(), px_find_hmac(), QTNCopy(), queryin(), queue_listen(), quote_identifier(), quote_literal(), quote_literal_cstr(), range_gist_picksplit(), RE_compile(), RE_compile_and_cache(), read_binary_file(), read_client_final_message(), read_stream_begin_impl(), read_whole_file(), readDatum(), readtup_heap(), ReadTwoPhaseFile(), rebuild_database_list(), record_cmp(), record_eq(), record_image_cmp(), record_image_eq(), record_in(), record_recv(), regclassout(), regcollationout(), regcomp_auth_token(), regconfigout(), regdatabaseout(), regdictionaryout(), regexec_auth_token(), regexp_fixed_prefix(), regnamespaceout(), regoperout(), regprocout(), regroleout(), regtypeout(), RelationBuildPartitionDesc(), RelationBuildTriggers(), RememberToFreeTupleDescAtEOX(), remove_dbtablespaces(), ReorderBufferQueueMessage(), repeat(), replace_text_regexp(), report_json_context(), resizeString(), rot13_passphrase(), rpad(), save_state_data(), scanner_init(), scram_build_secret(), scram_verify_plain_password(), SearchCatCacheList(), secure_open_server(), seg_out(), select_outer_pathkeys_for_merge(), sepgsql_fmgr_hook(), seq_redo(), serialize_expr_stats(), SerializeTransactionState(), set_relation_column_names(), set_rtable_names(), set_var_from_str(), setup_firstcall(), setup_pct_info(), setup_regexp_matches(), setup_test_matches(), show_trgm(), similar_escape_internal(), slot_fill_defaults(), spg_text_inner_consistent(), spg_text_leaf_consistent(), spgAllocSearchItem(), spgist_name_inner_consistent(), spgNewHeapItem(), SplitToVariants(), StartPrepare(), startScanKey(), statext_mcv_build(), statext_mcv_deserialize(), statext_ndistinct_build(), statext_ndistinct_deserialize(), statext_ndistinct_serialize(), StoreRelCheck(), str_casefold(), str_initcap(), str_tolower(), str_toupper(), str_udeescape(), string_to_bytea_const(), strlower_libc_mb(), strncoll_libc(), strnxfrm_libc(), strtitle_libc_mb(), strupper_libc_mb(), subxact_info_add(), subxact_info_read(), sync_queue_init(), test_custom_stats_var_from_serialized_data(), test_enc_conversion(), test_pattern(), test_random(), test_re_compile(), test_resowner_many(), test_resowner_priorities(), testdelete(), text_catenate(), text_reverse(), text_substring(), text_to_bits(), text_to_cstring(), TidListEval(), toast_fetch_datum(), toast_fetch_datum_slice(), toast_save_datum(), transformRelOptions(), translate(), TS_phrase_output(), ts_process_call(), tsqueryout(), tsqueryrecv(), tsquerytree(), tsvector_setweight(), tsvector_setweight_by_filter(), tsvector_to_array(), tsvector_unnest(), tsvectorout(), tuple_data_split_internal(), tuplesort_begin_batch(), tuplesort_putbrintuple(), tuplesort_putgintuple(), tuplestore_begin_common(), unicode_is_normalized(), unicode_normalize_func(), update_attstats(), uuid_decrement(), uuid_increment(), uuid_out(), uuid_recv(), uuid_skipsupport(), vac_open_indexes(), varbit(), varbit_out(), varbit_recv(), varstr_levenshtein(), varstr_sortsupport(), xid8out(), xidout(), XLogInsertRecord(), XLogReadRecordAlloc(), xml_recv(), xpath_string(), xpath_table(), yyalloc(), and yyrealloc().

◆ palloc0()

void * palloc0 ( Size  size)
extern

Definition at line 1417 of file mcxt.c.

1418{
1419 /* duplicates MemoryContextAllocZero to avoid increased overhead */
1420 void *ret;
1422
1423 Assert(MemoryContextIsValid(context));
1425
1426 context->isReset = false;
1427
1428 ret = context->methods->alloc(context, size, 0);
1429 /* We expect OOM to be handled by the alloc function */
1430 Assert(ret != NULL);
1431 VALGRIND_MEMPOOL_ALLOC(context, ret, size);
1432
1433 MemSetAligned(ret, 0, size);
1434
1435 return ret;
1436}

References MemoryContextMethods::alloc, Assert, AssertNotInCriticalSection, CurrentMemoryContext, fb(), MemoryContextData::isReset, MCXT_ALLOC_ZERO, MemoryContextIsValid, MemSetAligned, MemoryContextData::methods, pg_malloc_internal(), and VALGRIND_MEMPOOL_ALLOC.

Referenced by _bt_form_posting(), _bt_truncate(), _bt_unmark_keys(), _bt_update_posting(), _gin_build_tuple(), _ltq_extract_regex(), _ltree_extract_isparent(), _ltree_extract_risparent(), _ltxtq_extract_exec(), accum_sum_rescale(), add_column_to_pathtarget(), add_sp_item_to_pathtarget(), allocacl(), allocateReloptStruct(), AllocateSnapshotBuilder(), AlterObjectNamespace_internal(), AlterObjectOwner_internal(), AlterObjectRename_internal(), appendSCRAMKeysInfo(), array_cat(), array_get_slice(), array_in(), array_map(), array_recv(), array_replace_internal(), array_set_element(), array_set_slice(), array_to_tsvector(), BeginCopyFrom(), BeginCopyTo(), bernoulli_initsamplescan(), BipartiteMatch(), bit(), bit_in(), BlockRefTableEntryMarkBlockModified(), bloom_create(), bloom_init(), BloomFormTuple(), 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(), brin_range_serialize(), bt_page_print_tuples(), build_expanded_ranges(), build_expr_data(), build_mvdependencies(), build_sorted_items(), buildint2vector(), buildNSItemFromLists(), buildNSItemFromTupleDesc(), buildoidvector(), calc_word_similarity(), circle_poly(), collect_visibility_data(), combo_init(), compact_palloc0(), compile_plperl_function(), compile_pltcl_function(), connect_pg_server(), construct_md_array(), copy_ltree(), create_array_envelope(), create_groupingsets_plan(), 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(), cvt_text_name(), deparse_context_for_plan_tree(), dependencies_object_end(), do_analyze_rel(), dsm_impl_mmap(), EnumValuesCreate(), eqjoinsel(), ExecBuildGroupingEqual(), ExecBuildHash32Expr(), ExecBuildHash32FromAttrs(), ExecBuildParamSetEqual(), ExecEvalArrayExpr(), ExecEvalHashedScalarArrayOp(), ExecGrant_Relation(), ExecIndexBuildScanKeys(), ExecInitAppend(), ExecInitBitmapAnd(), ExecInitBitmapOr(), ExecInitExprRec(), ExecInitFunc(), ExecInitGenerated(), ExecInitIndexScan(), ExecInitJsonExpr(), ExecInitJunkFilterConversion(), ExecInitRangeTable(), ExecInitResultRelation(), ExecInitSetOp(), ExecInitSubscriptingRef(), ExecInitValuesScan(), expand_partitioned_rtentry(), expand_tuple(), expand_virtual_generated_columns(), ExplainCreateWorkersState(), extract_rollup_sets(), extract_variadic_args(), fetch_more_data(), fetch_remote_table_info(), fillFakeState(), 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(), get_crosstab_tuplestore(), get_matching_partitions(), get_relation_info(), GetAccessStrategyWithSize(), getColorInfo(), ginExtractEntries(), ginNewScanKey(), gist_indexsortbuild_levelstate_add(), grow_notnull_info(), heap_form_minimal_tuple(), heap_form_tuple(), heap_toast_insert_or_update(), heap_vacuum_rel(), hmac_init(), identify_join_columns(), init_returning_filter(), InitCatCache(), initHyperLogLog(), initSpGistState(), inittapes(), inline_function(), inner_subltree(), InstrAlloc(), int2vectorin(), interpret_function_parameter_list(), jsonb_exec_setup(), lca_inner(), leader_takeover_tapes(), leftmostvalue_name(), logicalrep_read_tuple(), ltree_concat(), ltree_picksplit(), ltree_union(), make_auth_token(), make_inh_translation_list(), make_multirange(), make_partitionedrel_pruneinfo(), make_setop_translation_list(), make_sort_input_target(), make_tsvector(), make_tuple_from_result_row(), make_tuple_indirect(), makeArrayResultArr(), MakeTupleTableSlot(), mergeruns(), minmax_multi_init(), MJExamineQuals(), mkVoidAffix(), multi_sort_init(), multirange_constructor2(), multirange_get_range(), multirange_intersect_internal(), multirange_minus_internal(), multirange_union(), nameconcatoid(), namein(), namerecv(), ndistinct_object_end(), new_intArrayType(), newNode(), newRegisNode(), oidvectorin(), ParallelSlotsSetup(), parse_lquery(), parse_ltree(), parse_tsquery(), pg_crypt(), pgoutput_truncate(), pgp_init(), plperl_modify_tuple(), plsample_func_handler(), pltcl_build_tuple_result(), PLy_modify_tuple(), poly_in(), poly_recv(), prepare_query_params(), PrepareForIncrementalBackup(), preparePresortedCols(), printtup_prepare_info(), pull_up_constant_function(), pull_up_simple_subquery(), pull_up_simple_values(), px_crypt_shacrypt(), QTN2QT(), queryin(), range_agg_finalfn(), range_serialize(), RelationBuildLocalRelation(), ReorderBufferProcessTXN(), ReorderBufferToastReplace(), reverse_name(), rewriteTargetListIU(), rewriteValuesRTE(), serialize_prepare_info(), set_append_rel_size(), set_deparse_for_query(), set_join_column_names(), set_plan_references(), set_simple_column_names(), set_subquery_pathlist(), SetExplainExtensionState(), SnapBuildSerialize(), spgFormInnerTuple(), spgFormLeafTuple(), spgFormNodeTuple(), spgist_name_leaf_consistent(), standard_join_search(), statext_dependencies_build(), statext_dependencies_deserialize(), statext_dependencies_serialize(), statext_mcv_build(), statext_mcv_deserialize(), statext_mcv_serialize(), statext_ndistinct_deserialize(), test_create(), testdelete(), text_name(), toast_flatten_tuple_to_datum(), transformFromClauseItem(), transformSetOperationStmt(), transformValuesClause(), transformWithClause(), tsqueryrecv(), tsvector_concat(), tsvector_delete_arr(), tsvector_delete_by_indices(), tsvector_filter(), tsvector_strip(), tsvectorin(), tsvectorrecv(), TupleDescGetAttInMetadata(), tuplesort_begin_cluster(), tuplesort_begin_heap(), tuplesort_begin_index_btree(), tuplesort_begin_index_gin(), tuplesort_begin_index_gist(), vacuum_all_databases(), and varbit_in().

◆ palloc_aligned()

void * palloc_aligned ( Size  size,
Size  alignto,
int  flags 
)
extern

Definition at line 1606 of file mcxt.c.

1607{
1609}
void * MemoryContextAllocAligned(MemoryContext context, Size size, Size alignto, int flags)
Definition mcxt.c:1482

References CurrentMemoryContext, fb(), and MemoryContextAllocAligned().

Referenced by _mdfd_getseg(), GenericXLogStart(), InitCatCache(), and modify_rel_block().

◆ palloc_extended()

void * palloc_extended ( Size  size,
int  flags 
)
extern

Definition at line 1439 of file mcxt.c.

1440{
1441 /* duplicates MemoryContextAllocExtended to avoid increased overhead */
1442 void *ret;
1444
1445 Assert(MemoryContextIsValid(context));
1447
1448 context->isReset = false;
1449
1450 ret = context->methods->alloc(context, size, flags);
1451 if (unlikely(ret == NULL))
1452 {
1453 /* NULL can be returned only when using MCXT_ALLOC_NO_OOM */
1454 Assert(flags & MCXT_ALLOC_NO_OOM);
1455 return NULL;
1456 }
1457
1458 VALGRIND_MEMPOOL_ALLOC(context, ret, size);
1459
1460 if ((flags & MCXT_ALLOC_ZERO) != 0)
1461 MemSetAligned(ret, 0, size);
1462
1463 return ret;
1464}
#define MCXT_ALLOC_NO_OOM
Definition fe_memutils.h:29

References MemoryContextMethods::alloc, Assert, AssertNotInCriticalSection, CurrentMemoryContext, fb(), MemoryContextData::isReset, MCXT_ALLOC_NO_OOM, MCXT_ALLOC_ZERO, MemoryContextIsValid, MemSetAligned, MemoryContextData::methods, pg_malloc_internal(), unlikely, and VALGRIND_MEMPOOL_ALLOC.

Referenced by AllocDeadEndChild(), apw_dump_now(), pg_clean_ascii(), and XLogReaderAllocate().

◆ pchomp()

◆ pfree()

void pfree ( void pointer)
extern

Definition at line 1616 of file mcxt.c.

1617{
1618#ifdef USE_VALGRIND
1619 MemoryContext context = GetMemoryChunkContext(pointer);
1620#endif
1621
1622 MCXT_METHOD(pointer, free_p) (pointer);
1623
1624 VALGRIND_MEMPOOL_FREE(context, pointer);
1625}
MemoryContext GetMemoryChunkContext(void *pointer)
Definition mcxt.c:756
#define MCXT_METHOD(pointer, method)
Definition mcxt.c:202

References GetMemoryChunkContext(), MCXT_METHOD, pg_free(), and VALGRIND_MEMPOOL_FREE.

Referenced by _brin_parallel_merge(), _bt_array_decrement(), _bt_array_increment(), _bt_array_set_low_or_high(), _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_newlevel(), _bt_parallel_restore_arrays(), _bt_pendingfsm_finalize(), _bt_preprocess_array_keys(), _bt_simpledel_pass(), _bt_skiparray_set_element(), _bt_skiparray_set_isnull(), _bt_sort_dedup_finish_pending(), _bt_split(), _bt_spooldestroy(), _bt_truncate(), _bt_unmark_keys(), _bt_uppershutdown(), _fdvec_resize(), _gin_build_tuple(), _gin_process_worker_data(), _h_spooldestroy(), _hash_splitbucket(), _hash_squeezebucket(), _int_contains(), _int_inter(), _int_overlap(), _int_same(), _int_union(), _lca(), _mdfd_getseg(), 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(), AlignedAllocFree(), AlignedAllocRealloc(), allocate_recordbuf(), AlterObjectNamespace_internal(), AlterObjectOwner_internal(), AlterObjectRename_internal(), appendJSONKeyValueFmt(), appendSCRAMKeysInfo(), AppendStringCommandOption(), appendStringInfoStringQuoted(), apply_scanjoin_target_to_paths(), apw_dump_now(), array_free_iterator(), array_in(), array_map(), array_out(), array_recv(), array_replace_internal(), array_reverse_n(), array_send(), array_set_element_expanded(), array_shuffle_n(), 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(), astreamer_extractor_free(), astreamer_plain_writer_free(), astreamer_recovery_injector_free(), astreamer_tar_archiver_free(), astreamer_tar_parser_free(), astreamer_tar_terminator_free(), astreamer_verify_free(), Async_Notify(), AtEOSubXact_Inval(), AtEOSubXact_on_commit_actions(), AtEOSubXact_PgStat(), AtEOSubXact_PgStat_DroppedStats(), AtEOSubXact_PgStat_Relations(), AtEOXact_GUC(), AtEOXact_on_commit_actions(), AtEOXact_PgStat_DroppedStats(), AtEOXact_RelationCache(), ATPrepAlterColumnType(), AtSubAbort_childXids(), AtSubAbort_Notify(), AtSubAbort_Snapshot(), AtSubCommit_childXids(), AtSubCommit_Notify(), AttrDefaultFetch(), autoinc(), BackendInitialize(), bbsink_server_begin_archive(), bbsink_server_begin_manifest(), bbsink_server_end_manifest(), be_tls_close(), be_tls_open_server(), binaryheap_free(), bind_param_error_callback(), BipartiteMatchFree(), blendscan(), blgetbitmap(), BlockRefTableEntryMarkBlockModified(), BlockRefTableFreeEntry(), BlockRefTableReaderNextRelation(), bloom_free(), blrescan(), bms_add_members(), bms_del_member(), bms_del_members(), bms_free(), bms_int_members(), bms_intersect(), bms_join(), bms_replace_members(), boolop(), BootstrapModeMain(), bottomup_sort_and_shrink(), bpcharfastcmp_c(), bpcharrecv(), bqarr_in(), brin_bloom_union(), 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(), brininsertcleanup(), brinRevmapTerminate(), brinsummarize(), bt_check_level_from_leftmost(), bt_child_check(), bt_child_highkey_check(), bt_downlink_missing_check(), bt_leftmost_ignoring_half_dead(), 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(), BufFileOpenFileSet(), build_child_join_sjinfo(), build_EvalXFuncInt(), build_index_paths(), build_local_reloptions(), build_mvdependencies(), build_mvndistinct(), build_pertrans_for_aggref(), build_reloptions(), build_sorted_items(), buildFreshLeafTuple(), BuildRestoreCommand(), BuildTupleFromCStrings(), bytea_abbrev_convert(), byteafastcmp(), cache_single_string(), cached_function_compile(), calc_arraycontsel(), calc_distr(), calc_rank_and(), calc_rank_cd(), calc_rank_or(), calc_word_similarity(), calculate_partition_bound_for_merge(), cancel_on_dsm_detach(), casefold(), cash_words(), CatalogCloseIndexes(), CatCacheFreeKeys(), CatCacheRemoveCList(), CatCacheRemoveCTup(), char2wchar(), check_application_name(), check_circularity(), check_cluster_name(), check_control_files(), check_createrole_self_grant(), check_datestyle(), check_db_file_conflict(), check_debug_io_direct(), check_default_text_search_config(), check_ident_usermap(), check_locale(), check_log_connections(), check_log_destination(), check_oauth_validator(), check_partitions_for_split(), check_publications(), check_publications_origin_sequences(), check_publications_origin_tables(), check_relation_privileges(), check_restrict_nonsystem_relation_kind(), check_schema_perms(), check_search_path(), check_synchronized_standby_slots(), check_temp_tablespaces(), check_timezone(), check_wal_consistency_checking(), CheckAffix(), CheckAlterSubOption(), checkclass_str(), checkcondition_str(), CheckForBufferLeaks(), CheckForLocalBufferLeaks(), CheckIndexCompatible(), CheckMD5Auth(), CheckNNConstraintFetch(), CheckPasswordAuth(), CheckPointTwoPhase(), CheckPWChallengeAuth(), CheckRADIUSAuth(), CheckSASLAuth(), checkSharedDependencies(), choose_plan_name(), 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_directories_atexit(), cleanup_subxact_info(), clear_and_pfree(), close_tsvector_parser(), ClosePostmasterPorts(), collectMatchBitmap(), 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(), convert_any_priv_string(), convert_charset(), convert_column_name(), convert_string_datum(), convert_to_scalar(), convertPgWchar(), copy_connection(), copy_dest_destroy(), copy_file(), copy_table(), CopyArrayEls(), CopyFromErrorCallback(), CopyFromTextLikeOneRow(), CopyMultiInsertBufferCleanup(), copyTemplateDependencies(), core_yyfree(), count_usable_fds(), create_cursor(), create_hash_bounds(), create_list_bounds(), create_partitionwise_grouping_paths(), create_range_bounds(), create_script_for_old_cluster_deletion(), create_secmsg(), create_tablespace_directories(), CreateCheckPoint(), CreateDatabaseUsingFileCopy(), CreateDatabaseUsingWalLog(), createdb(), createPostingTree(), CreateStatistics(), CreateTableSpace(), CreateTriggerFiringOn(), croak_cstr(), crosstab(), cstr2sv(), datetime_format_has_tz(), datetime_to_char_body(), datum_image_eq(), datum_image_hash(), datum_to_json_internal(), datumSerialize(), db_encoding_convert(), dbase_redo(), DCH_to_char(), deallocate_query(), DecodeTextArrayToBitmapset(), DeconstructFkConstraintRow(), DefineDomain(), DefineEnum(), DefineRange(), DefineType(), deleteSplitPartitionContext(), deparseConst(), dependencies_clauselist_selectivity(), DependencyGenerator_free(), deserialize_deflist(), destroy_tablespace_directories(), DestroyBlockRefTableReader(), DestroyBlockRefTableWriter(), DestroyParallelContext(), destroyStringInfo(), DestroyTupleQueueReader(), detoast_attr(), detoast_attr_slice(), digest_free(), dintdict_lexize(), dir_realloc(), dispell_init(), dispell_lexize(), div_var(), do_analyze_rel(), do_autovacuum(), Do_MultiXactIdWait(), do_pg_backup_start(), do_pg_backup_stop(), do_text_output_multiline(), do_to_timestamp(), DoesMultiXactIdConflict(), dofindsubquery(), dotrim(), DropRelationFiles(), DropRelationsAllBuffers(), 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(), emit_audit_message(), encrypt_free(), end_tup_output(), EndCopy(), EndCopyFrom(), enlarge_list(), entry_dealloc(), entry_purge_tuples(), entryLoadMoreItems(), enum_range_internal(), enum_recv(), EnumValuesCreate(), eqjoinsel(), escape_json_text(), eval_windowaggregates(), EventTriggerAlterTableEnd(), EventTriggerSQLDropAddObject(), examine_attribute(), examine_attribute(), examine_expression(), exec_bind_message(), exec_command_conninfo(), exec_command_unrestrict(), exec_object_restorecon(), exec_stmt_foreach_a(), ExecAggCopyTransValue(), ExecDropSingleTupleTableSlot(), ExecEndWindowAgg(), ExecEvalPreOrderedDistinctSingle(), ExecEvalXmlExpr(), ExecFetchSlotHeapTupleDatum(), ExecForceStoreHeapTuple(), ExecForceStoreMinimalTuple(), ExecGrant_Attribute(), ExecGrant_common(), ExecGrant_Largeobject(), ExecGrant_Parameter(), ExecGrant_Relation(), ExecHashIncreaseNumBatches(), ExecHashRemoveNextSkewBucket(), ExecHashTableDestroy(), ExecIndexBuildScanKeys(), ExecInitGenerated(), ExecInitHashJoin(), ExecInitMemoize(), ExecParallelCleanup(), ExecParallelFinish(), ExecParallelHashCloseBatchAccessors(), ExecParallelHashRepartitionRest(), ExecReScanTidScan(), ExecResetTupleTable(), ExecSetParamPlan(), ExecSetSlotDescriptor(), ExecShutdownGatherMergeWorkers(), ExecShutdownGatherWorkers(), execute_foreign_modify(), executeDateTimeMethod(), executeItemOptUnwrapTarget(), ExecuteRecoveryCommand(), 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_relation_list(), fetch_remote_slots(), fetch_remote_table_info(), fetch_statentries_for_relation(), file_acquire_sample_rows(), filter_list_to_array(), finalize_aggregates(), FinalizeIncrementalManifest(), find_in_path(), find_in_paths(), find_inheritance_children_extended(), find_other_exec(), find_provider(), findDependentObjects(), findeq(), findJsonbValueFromContainer(), finish_edata(), FinishPreparedTransaction(), fix_merged_indexes(), fixup_inherited_columns(), flush_pipe_input(), FlushRelationsAllBuffers(), fmgr_info_C_lang(), fmgr_info_cxt_security(), ForgetBackgroundWorker(), ForgetManyTestResources(), form_and_insert_tuple(), form_and_spill_tuple(), free_attrmap(), free_attstatsslot(), free_child_join_sjinfo(), 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(), FreeConfigVariable(), FreeErrorData(), FreeErrorDataContents(), FreeExprContext(), FreeFakeRelcacheEntry(), freeGinBtreeStack(), freeHyperLogLog(), FreeOldMultiXactReader(), FreeQueryDesc(), FreeSnapshot(), FreeSubscription(), freetree(), FreeTriggerDesc(), FreeTupleDesc(), FreeWaitEventSet(), FreeWaitEventSetAfterFork(), FreezeMultiXactId(), func_get_detail(), FuncnameGetCandidates(), g_int_compress(), g_int_consistent(), g_int_decompress(), g_int_penalty(), g_int_picksplit(), 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_error_response(), 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_control_directories(), 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(), GetAggInitVal(), GetAggInitVal(), getColorInfo(), GetConfFilesInDir(), getFileContentType(), GetMultiXactIdHintBits(), getNextNearest(), getObjectDescription(), getObjectIdentityParts(), getPublicationSchemaInfo(), GetTempNamespaceProcNumber(), GetWALRecordsInfo(), GetWalStats(), gin_check_parent_keys_consistency(), gin_check_posting_tree_parent_keys_consistency(), gin_extract_jsonb_path(), gin_leafpage_items(), gin_trgm_triconsistent(), GinBufferFree(), GinBufferReset(), GinBufferStoreTuple(), ginCompressPostingList(), ginendscan(), ginEntryFillRoot(), ginEntryInsert(), ginExtractEntries(), ginFinishSplit(), ginFlushBuildState(), GinFormTuple(), ginFreeScanKeys(), ginNewScanKey(), ginPostingListDecodeAllSegmentsToTbm(), ginVacuumEntryPage(), ginVacuumPostingTree(), ginVacuumPostingTreeLeaf(), gist_indexsortbuild(), gist_indexsortbuild_levelstate_flush(), gist_ischild(), gistgetbitmap(), gistgettuple(), gistPopItupFromNodeBuffer(), gistRelocateBuildBuffersOnSplit(), gistrescan(), gistunionsubkeyvec(), gistUnloadNodeBuffer(), group_similar_or_args(), gtrgm_consistent(), gtrgm_distance(), gtrgm_penalty(), gtsvector_penalty(), guc_free(), GUCArrayReset(), 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_should_freeze(), heap_vacuum_rel(), heapam_index_fetch_end(), 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(), icu_language_tag(), index_compute_xid_horizon_for_tuples(), index_concurrently_create_copy(), index_form_tuple_context(), index_truncate_tuple(), IndexScanEnd(), infix(), infix(), infix(), initcap(), InitExecPartitionPruneContexts(), initialize_reloptions(), InitializeSystemUser(), InitPostgres(), initTrie(), InitWalRecovery(), inner_int_inter(), insert_username(), InsertOneTuple(), InsertPgAttributeTuples(), internal_citext_pattern_cmp(), internalerrquery(), intorel_destroy(), intset_subtract(), inv_close(), inv_getsize(), inv_read(), inv_truncate(), inv_write(), InvalidateAttoptCacheCallback(), InvalidateTableSpaceCacheCallback(), irbt_free(), isAnyTempNamespace(), isolation_start_test(), iterate_jsonb_values(), iterate_word_similarity(), jit_release_context(), json_manifest_finalize_file(), json_manifest_finalize_wal_range(), json_manifest_object_field_start(), json_manifest_scalar(), json_object(), json_object_keys(), json_object_two_arg(), json_parse_manifest_incremental_shutdown(), json_unique_object_end(), json_unique_object_field_start(), jsonb_object(), jsonb_object_two_arg(), jsonb_send(), jsonb_set_element(), JsonbDeepContains(), JsonbValue_to_SV(), JsonItemFromDatum(), jsonpath_send(), jsonpath_yyfree(), KnownAssignedXidsDisplay(), lazy_cleanup_one_index(), lazy_vacuum_one_index(), lca(), leafRepackItems(), libpq_destroy(), libpqrcv_alter_slot(), libpqrcv_connect(), libpqrcv_create_slot(), libpqrcv_disconnect(), libpqrcv_get_option_from_conninfo(), libpqrcv_startstreaming(), libpqsrv_PGresultSetParent(), libpqsrv_PQclear(), like_fixed_prefix(), like_fixed_prefix_ci(), list_delete_first_n(), list_delete_nth_cell(), list_free_private(), llvm_compile_module(), llvm_copy_attributes_at_index(), llvm_release_context(), llvm_resolve_symbol(), llvm_resolve_symbols(), lo_manage(), load_backup_manifest(), load_enum_cache_data(), load_external_function(), load_file(), load_libraries(), load_relcache_init_file(), local_destroy(), LockAcquireExtended(), log_status_format(), logfile_rotate_dest(), logical_heap_rewrite_flush_mappings(), logicalrep_relmap_free_entry(), logicalrep_write_tuple(), LogicalRepSyncSequences(), LogicalTapeClose(), LogicalTapeFreeze(), LogicalTapeRewindForRead(), LogicalTapeSetClose(), LogRecoveryConflict(), LogStandbySnapshot(), lookup_ts_config_cache(), lookup_var_attr_stats(), LookupGXact(), lower(), lquery_recv(), lquery_send(), lrq_free(), ltree_addtext(), ltree_picksplit(), ltree_prefix_eq_ci(), ltree_recv(), ltree_send(), ltree_textadd(), ltxtq_recv(), ltxtq_send(), lz4_compress_datum(), main(), main(), make_greater_string(), make_partition_pruneinfo(), make_partitionedrel_pruneinfo(), make_SAOP_expr(), make_scalar_key(), make_tsvector(), make_tuple_indirect(), makeArrayTypeName(), makeMultirangeConstructors(), map_sql_value_to_xml_value(), mark_hl_fragments(), MatchText(), MaybeRemoveOldWalSummaries(), mbuf_free(), mcelem_array_contained_selec(), mcelem_array_selec(), mcelem_tsquery_selec(), mcv_clause_selectivity_or(), mcv_get_match_bitmap(), mdcbuf_free(), merge_acl_with_grant(), merge_clump(), mergeruns(), mkANode(), moddatetime(), mode_final(), moveArrayTypeName(), movedb(), movedb_failure_callback(), mq_putmessage(), mul_var(), multirange_recv(), MultiXactIdExpand(), MultiXactIdGetUpdateXid(), MultiXactIdIsRunning(), mXactCachePut(), mxid_to_string(), namerecv(), next_field_expand(), NIImportAffixes(), NIImportDictionary(), NIImportOOAffixes(), NINormalizeWord(), NormalizeSubWord(), NUM_cache(), numeric_abbrev_convert(), numeric_fast_cmp(), numeric_float4(), numeric_float8(), numeric_poly_stddev_internal(), numeric_to_number(), numericvar_to_double_no_overflow(), object_aclmask_ext(), overexplain_alias(), overexplain_bitmapset(), overexplain_intlist(), pa_free_worker_info(), pa_launch_parallel_worker(), pad_eme_pkcs1_v15(), PageRestoreTempPage(), pagetable_free(), pair_encode(), pairingheap_free(), parallel_vacuum_end(), parallel_vacuum_init(), parallel_vacuum_process_one_index(), ParameterAclLookup(), parse_and_validate_value(), parse_args(), parse_compress_specification(), parse_extension_control_file(), parse_fcall_arguments(), parse_hba_line(), parse_lquery(), parse_ltree(), parse_manifest_file(), parse_one_reloption(), parse_subscription_options(), parse_tsquery(), parseCommandLine(), ParseConfigFile(), ParseConfigFp(), parseNameAndArgTypes(), parseRelOptionsInternal(), parsetext(), patternsel_common(), pclose_check(), perform_base_backup(), perform_work_item(), PerformAuthentication(), PerformRadiusTransaction(), PerformWalRecovery(), pg_armor(), pg_attribute_aclcheck_all_ext(), pg_attribute_aclmask_ext(), pg_backup_stop(), pg_be_scram_build_secret(), pg_class_aclmask_ext(), pg_convert(), pg_crypt(), pg_dearmor(), pg_decode_commit_txn(), pg_decode_stream_abort(), pg_decode_stream_commit(), pg_encrypt(), pg_extension_update_paths(), 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_get_wal_block_info(), pg_get_wal_record_info(), pg_identify_object_as_address(), pg_largeobject_aclmask_snapshot(), pg_namespace_aclmask_ext(), pg_parameter_acl_aclmask(), pg_parameter_aclmask(), pg_parse_query(), pg_plan_query(), 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_sync_replication_slots(), pg_tablespace_databases(), pg_type_aclmask_ext(), pg_tzenumerate_end(), pg_tzenumerate_next(), pgfnames_cleanup(), pglz_compress_datum(), pgoutput_commit_txn(), pgp_cfb_free(), pgp_create_pkt_reader(), pgp_free(), pgp_key_free(), pgp_mpi_free(), pgss_shmem_startup(), pgss_store(), pgstat_delete_pending_entry(), pgstat_release_entry_ref(), 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_compile_callback(), 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_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_subtransaction_exit(), PLy_traceback(), PLy_trigger_build_args(), PLyGenericObject_ToComposite(), PLyMapping_ToComposite(), PLyNumber_ToJsonbValue(), PLySequence_ToComposite(), PLyUnicode_Bytes(), PLyUnicode_FromScalar(), PLyUnicode_FromStringAndSize(), PopActiveSnapshot(), PopTransaction(), populate_array(), populate_record(), populate_scalar(), PortalDrop(), postgresExecForeignTruncate(), postgresGetForeignJoinPaths(), PostmasterMain(), PostPrepare_smgr(), pprint(), pq_cleanup_redirect_to_shm_mq(), pq_endmessage(), pq_puttextmessage(), pq_sendcountedtext(), pq_sendstring(), pq_sendtext(), pq_writestring(), PrepareTempTablespaces(), preprocessNamespacePath(), PrescanPreparedTransactions(), print(), print_expr(), print_function_arguments(), printtup_destroy(), printtup_prepare_info(), printtup_shutdown(), ProcArrayApplyRecoveryInfo(), process_directory_recursively(), process_ordered_aggregate_single(), process_pipe_input(), process_postgres_switches(), process_rel_infos(), process_target_wal_block_change(), ProcessCommittedInvalidationMessages(), ProcessConfigFileInternal(), ProcessGUCArray(), ProcessParallelApplyMessages(), ProcessParallelMessages(), ProcessPgArchInterrupts(), ProcessStandbyHSFeedbackMessage(), ProcessStandbyReplyMessage(), ProcessStartupPacket(), ProcessWalSndrMessage(), ProcSleep(), prs_process_call(), prune_element_hashtable(), prune_lexemes_hashtable(), psprintf(), psql_add_command(), psql_start_test(), pullf_free(), pushf_free(), PushTransaction(), pushval_morph(), px_crypt_shacrypt(), px_find_cipher(), px_find_combo(), px_find_digest(), QTNFree(), QTNTernary(), queryin(), range_fast_cmp(), range_recv(), rbt_populate(), RE_compile(), RE_compile_and_cache(), RE_execute(), read_client_final_message(), read_dictionary(), read_stream_end(), ReadArrayStr(), readfile(), readstoplist(), recheck_relation_needs_vacanalyze(), reconstruct_from_incremental_file(), 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(), regcomp_auth_token(), regex_fixed_prefix(), regexec_auth_token(), regexp_fixed_prefix(), regression_main(), RehashCatCache(), RehashCatCacheLists(), reindex_one_database(), ReinitializeParallelDSM(), RelationBuildPartitionKey(), RelationBuildPublicationDesc(), RelationBuildRowSecurity(), RelationBuildRuleLock(), RelationBuildTriggers(), RelationBuildTupleDesc(), RelationCacheInitializePhase3(), RelationDestroyRelation(), RelationGetDummyIndexExpressions(), RelationGetIndexAttOptions(), RelationGetIndexExpressions(), RelationGetIndexPredicate(), RelationInvalidateRelation(), RelationParseRelOptions(), RelationPreserveStorage(), RelationReloadIndexInfo(), ReleaseDummy(), ReleaseManyTestResource(), ReleasePostmasterChildSlot(), relmap_redo(), remove_cache_entry(), remove_dbtablespaces(), remove_leftjoinrel_from_query(), remove_self_join_rel(), RemoveLocalLock(), RenameTypeInternal(), ReorderBufferAddDistributedInvalidations(), ReorderBufferFreeChange(), ReorderBufferFreeRelids(), ReorderBufferFreeSnap(), ReorderBufferFreeTupleBuf(), ReorderBufferFreeTXN(), ReorderBufferIterTXNFinish(), ReorderBufferToastReplace(), ReorderBufferToastReset(), reorderqueue_pop(), replace_auto_config_value(), replace_text(), replace_text_regexp(), replication_scanner_finish(), ReplicationSlotDropAtPubNode(), ReplicationSlotRelease(), ReplicationSlotValidateName(), ReplSlotSyncWorkerMain(), report_corruption_internal(), report_triggers(), reportDependentObjects(), ReportGUCOption(), ReportSlotInvalidation(), reset_directory_cleanup_list(), reset_on_dsm_detach(), ResetDecoder(), resetSpGistScanOpaque(), resolve_aggregate_transtype(), ResourceOwnerDelete(), ResourceOwnerEnlarge(), ResourceOwnerReleaseAll(), RestoreArchivedFile(), RestoreArchivedFile(), rewriteTargetListIU(), rewriteValuesRTE(), rm_redo_error_callback(), rmtree(), RS_free(), RT_END_ITERATE(), RT_FREE(), RT_FREE_LEAF(), RT_FREE_NODE(), run_ssl_passphrase_command(), scanner_finish(), scanPendingInsert(), scram_verify_plain_password(), secure_open_server(), select_active_windows(), select_outer_pathkeys_for_merge(), send_message_to_frontend(), send_message_to_server_log(), sendDir(), 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(), serialize_prepare_info(), serializeAnalyzeDestroy(), serializeAnalyzeShutdown(), 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(), set_windowagg_runcondition_references(), SetClientEncoding(), setCorrLex(), setNewTmpRes(), setup_regexp_matches(), setup_test_matches(), shdepLockAndCheckObject(), shell_archive_file(), shell_finish_command(), shm_mq_detach(), shm_mq_receive(), show_memoize_info(), show_trgm(), show_window_def(), show_window_keys(), ShowAllGUCConfig(), ShowTransactionStateRec(), ShowUsage(), ShutdownExprContext(), ShutdownWalRecovery(), similarity(), single_encode(), slotsync_reread_config(), smgr_bulk_flush(), smgrDoPendingDeletes(), smgrDoPendingSyncs(), smgrdounlinkall(), SnapBuildFreeSnapshot(), SnapBuildPurgeOlderTxn(), SnapBuildRestore(), SnapBuildSerialize(), spg_box_quad_inner_consistent(), spgClearPendingList(), spgdoinsert(), spgendscan(), spgFreeSearchItem(), spggettuple(), spgRedoVacuumRedirect(), SPI_cursor_open(), SPI_modifytuple(), SPI_pfree(), split_text(), SplitIdentifierString(), SplitToVariants(), sqlfunction_destroy(), StandbyRecoverPreparedTransactions(), StandbyTransactionIdIsPrepared(), start_table_sync(), StartPrepare(), startScanEntry(), StartupRereadConfig(), StartupXLOG(), statatt_build_stavalues(), statext_dependencies_free(), statext_mcv_build(), statext_mcv_deserialize(), statext_mcv_free(), statext_mcv_serialize(), statext_ndistinct_free(), StoreAttrDefault(), storeObjectDescription(), StorePartitionKey(), StoreRelCheck(), storeRow(), string_to_text(), stringToQualifiedNameList(), strlower_libc_mb(), strncoll_libc(), strnxfrm_libc(), strtitle_libc_mb(), strupper_libc_mb(), sts_end_write(), sts_read_tuple(), SummarizeWAL(), sync_queue_destroy(), SyncPostCheckpoint(), syncrep_scanner_finish(), SyncRepGetNthLatestSyncRecPtr(), SyncRepGetSyncRecPtr(), SysLogger_Start(), SysLoggerMain(), systable_beginscan(), systable_beginscan_ordered(), systable_endscan(), systable_endscan_ordered(), table_recheck_autovac(), tablesample_init(), TablespaceCreateDbspace(), tbm_end_private_iterate(), tbm_end_shared_iterate(), tbm_free(), terminate_brin_buildstate(), test_basic(), test_bms_overlap_list(), test_custom_stats_var_from_serialized_data(), test_destroy(), test_enc_conversion(), test_protocol_version(), test_random(), test_random_operations(), 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(), TidStoreDestroy(), TidStoreDetach(), TidStoreEndIterate(), 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_auth_file(), tokenize_expand_file(), tokenize_include_file(), TParserClose(), TParserCopyClose(), TParserGet(), tqueueDestroyReceiver(), tqueueReceiveSlot(), TransformGUCArray(), transformRangeTableFunc(), transientrel_destroy(), try_partitionwise_join(), ts_accum(), TS_execute_locations_recurse(), 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(), tts_virtual_clear(), tuple_data_split(), tuple_data_split_internal(), tuplesort_begin_batch(), tuplesort_begin_cluster(), tuplesort_begin_index_btree(), tuplestore_advance(), tuplestore_end(), tuplestore_skiptuples(), tuplestore_trim(), typeDepNeeded(), typenameTypeMod(), unaccent_dict(), uniqueentry(), uniqueWORD(), unistr(), UnregisterExprContextCallback(), UnregisterResourceReleaseCallback(), UnregisterSubXactCallback(), UnregisterXactCallback(), updateAclDependenciesWorker(), UpdateIndexRelation(), UpdateLogicalMappings(), upper(), uuid_decrement(), uuid_increment(), vac_close_indexes(), validate(), validate_remote_info(), varcharrecv(), varlenafastcmp_locale(), varstr_abbrev_convert(), varstrfastcmp_c(), verify_backup_checksums(), verify_cb(), verify_control_file(), verify_plain_backup_directory(), verify_tar_backup(), wait_for_connection_state(), WaitForOlderSnapshots(), WaitForParallelWorkersToExit(), walrcv_clear_result(), WalRcvFetchTimeLineHistoryFiles(), WalReceiverMain(), worker_freeze_result_tape(), write_auto_conf_file(), write_console(), write_csvlog(), write_jsonlog(), write_reconstructed_file(), X509_NAME_field_to_text(), X509_NAME_to_cstring(), XLogDecodeNextRecord(), XLogDumpDisplayRecord(), XLogInsertRecord(), XLogPrefetcherFree(), XLogReaderAllocate(), XLogReaderFree(), XLogReleasePreviousRecord(), XLOGShmemInit(), xml_encode_special_chars(), xml_out_internal(), xml_recv(), xml_send(), xmlconcat(), xmlpi(), xpath_bool(), xpath_list(), xpath_nodeset(), xpath_number(), xpath_string(), xpath_table(), and yyfree().

◆ pnstrdup()

◆ psprintf()

char * psprintf ( const char fmt,
  ... 
)
extern

◆ pstrdup()

char * pstrdup ( const char in)
extern

Definition at line 1781 of file mcxt.c.

1782{
1784}
char * MemoryContextStrdup(MemoryContext context, const char *string)
Definition mcxt.c:1768

References CurrentMemoryContext, MemoryContextStrdup(), and pg_strdup().

Referenced by AbsoluteConfigLocation(), accesstype_arg_to_string(), add_row_identity_var(), add_with_check_options(), addCompiledLexeme(), addFkConstraint(), addRangeTableEntryForFunction(), addRangeTableEntryForGroup(), addRangeTableEntryForSubquery(), addRangeTableEntryForTableFunc(), addRangeTableEntryForValues(), AddRelationNotNullConstraints(), addToResult(), allocate_reloption(), AllocSlruSegState(), AlterRole(), analyzeCTETargetList(), anytime_typmodout(), anytimestamp_typmodout(), append_database_pattern(), append_relation_pattern_helper(), append_schema_pattern(), ApplyRetrieveRule(), array_out(), astreamer_extractor_new(), astreamer_gzip_writer_new(), astreamer_plain_writer_new(), ATExecAddIndexConstraint(), ATExecAlterConstraint(), ATExecAlterConstrEnforceability(), ATParseTransformCmd(), BaseBackupAddTarget(), BeginCopyFrom(), BeginCopyTo(), BootstrapModeMain(), BufFileCreateFileSet(), BufFileOpenFileSet(), build_datatype(), build_minmax_path(), build_server_first_message(), buildDefItem(), BuildOnConflictExcludedTargetlist(), buildRelationAliases(), BuildRestoreCommand(), CatalogCacheInitializeCache(), check_createrole_self_grant(), check_datestyle(), check_debug_io_direct(), check_hostname(), check_locale(), check_log_connections(), check_log_destination(), check_oauth_validator(), check_restrict_nonsystem_relation_kind(), check_search_path(), check_selective_binary_conversion(), check_synchronized_standby_slots(), check_temp_tablespaces(), check_timezone(), check_tuple_header(), check_tuple_visibility(), check_valid_internal_signature(), check_wal_consistency_checking(), checkInsertTargets(), choose_plan_name(), ChooseExtendedStatisticNameAddition(), ChooseForeignKeyConstraintNameAddition(), ChooseIndexColumnNames(), ChooseIndexNameAddition(), CloneRowTriggersToPartition(), compile_database_list(), compile_plperl_function(), compile_pltcl_function(), compile_relation_list_one_db(), compileTheSubstitute(), connectby_text(), connectby_text_serial(), convert_GUC_name_for_parameter_acl(), convert_string_datum(), CopyCachedPlan(), CopyErrorData(), CopyLimitPrintoutLength(), CopyTriggerDesc(), copyTSLexeme(), CopyVar(), create_foreign_modify(), CreateCachedPlan(), CreateLockFile(), createNewConnection(), CreateParallelContext(), CreateSchemaCommand(), createTableConstraints(), CreateTableSpace(), CreateTupleDescCopyConstr(), cstring_in(), cstring_out(), datasegpath(), date_out(), dbase_redo(), defGetString(), DefineQueryRewrite(), DefineView(), DefineViewRules(), deleteConnection(), destroy_tablespace_directories(), DetachPartitionFinalize(), determineNotNullFlags(), determineRecursiveColTypes(), do_pg_backup_start(), DoCopy(), DropSubscription(), dsynonym_init(), ean13_out(), encrypt_password(), enum_out(), exec_bind_message(), exec_command_restrict(), exec_execute_message(), executeItemOptUnwrapTarget(), expand_dynamic_library_name(), expand_inherited_rtentry(), expand_insert_targetlist(), expand_single_inheritance_child(), ExpandRowReference(), expandRTE(), expandTableLikeClause(), expandTupleDesc(), ExportSnapshot(), extension_file_exists(), extract_slot_names(), ExtractExtensionList(), fetch_statentries_for_relation(), fill_hba_line(), filter_list_to_array(), find_in_paths(), find_plan(), flatten_set_variable_args(), float4in_internal(), float8in_internal(), fmgr_symbol(), format_operator_parts(), format_procedure_parts(), format_type_extended(), from_char_seq_search(), generate_append_tlist(), generate_setop_tlist(), generateClonedIndexStmt(), generateJsonTablePathName(), get_am_name(), get_attname(), get_collation(), get_collation_actual_version_libc(), get_collation_name(), get_configdata(), get_connect_string(), get_constraint_name(), get_database_list(), get_database_name(), get_ext_ver_info(), get_ext_ver_list(), get_extension_control_directories(), get_extension_name(), get_extension_script_directory(), get_file_fdw_attribute_options(), get_func_name(), get_language_name(), get_namespace_name(), get_namespace_name_or_temp(), get_opclass(), get_opfamily_name(), get_opname(), get_publication_name(), get_rel_name(), get_rolespec_name(), get_source_line(), get_sql_insert(), get_sql_update(), get_subscription_list(), get_subscription_name(), get_tablespace_location(), get_tablespace_name(), getAdditionalACLs(), getAttributesList(), GetConfFilesInDir(), GetConfigOptionValues(), getConnectionByName(), GetDatabasePath(), GetForeignDataWrapperExtended(), GetForeignServerExtended(), GetJsonBehaviorValueString(), getNamespaces(), getObjectIdentityParts(), getOpFamilyIdentity(), GetPublication(), getRecoveryStopReason(), getRelationIdentity(), getRelationStatistics(), GetSubscription(), getTokenTypes(), GetUserNameFromId(), GetWaitEventCustomNames(), gtsvectorout(), heap_vacuum_rel(), hstore_out(), ImportForeignSchema(), indent_lines(), injection_points_attach(), InjectionPointList(), internal_yylex(), interpret_AS_clause(), interpret_function_parameter_list(), interval_out(), isn_out(), iterate_values_object_field_start(), json_build_object_worker(), JsonbUnquote(), JsonTableInitOpaque(), lazy_cleanup_one_index(), lazy_vacuum_one_index(), libpqrcv_check_conninfo(), libpqrcv_create_slot(), libpqrcv_get_conninfo(), libpqrcv_get_option_from_conninfo(), libpqrcv_get_senderinfo(), libpqrcv_identify_system(), libpqrcv_readtimelinehistoryfile(), llvm_error_message(), llvm_function_reference(), llvm_set_target(), llvm_split_symbol_name(), load_domaintype_info(), load_libraries(), Lock_AF_UNIX(), logicalrep_partition_open(), logicalrep_read_attrs(), logicalrep_read_origin(), logicalrep_read_rel(), logicalrep_read_typ(), logicalrep_relmap_update(), LogicalRepSyncSequences(), main(), main(), make_rfile(), makeAlias(), makeColumnDef(), makeJsonTablePathSpec(), makeMultirangeTypeName(), map_sql_value_to_xml_value(), MarkGUCPrefixReserved(), MergeAttributes(), MergeCheckConstraint(), name_active_windows(), nameout(), network_out(), new_ExtensionControlFile(), NINormalizeWord(), NormalizeSubWord(), nullable_string(), numeric_normalize(), numeric_out(), numeric_out_sci(), oauth_exchange(), obtain_object_name_namespace(), okeys_object_field_start(), parallel_vacuum_main(), parallel_vacuum_process_one_index(), parse_compress_specification(), parse_extension_control_file(), parse_hba_auth_opt(), parse_hba_line(), parse_ident_line(), parse_output_parameters(), parse_publication_options(), parse_scram_secret(), parse_subscription_options(), ParseConfigFp(), ParseLongOption(), parseNameAndArgTypes(), ParseTzFile(), perform_base_backup(), PerformCursorOpen(), pg_available_extension_versions(), pg_available_extensions(), pg_import_system_collations(), pg_lsn_out(), pg_split_opts(), pg_split_walfile_name(), pg_tzenumerate_next(), pg_tzenumerate_start(), pgfnames(), pgrowlocks(), pgstatindex_impl(), plperl_init_interp(), plperl_to_hstore(), plpgsql_build_recfield(), plpgsql_build_record(), plpgsql_build_variable(), plpgsql_compile_callback(), plpgsql_compile_inline(), plpgsql_extra_checks_check_hook(), plsample_func_handler(), plsample_trigger_handler(), pltcl_set_tuple_values(), PLy_output(), PLy_procedure_create(), PLyObject_AsString(), PLyUnicode_AsString(), populate_scalar(), postgresImportForeignSchema(), PostmasterMain(), pq_parse_errornotice(), precheck_tar_backup_file(), prepare_foreign_modify(), prepare_sql_fn_parse_info(), PrepareTempTablespaces(), preprocess_targetlist(), preprocessNamespacePath(), print_function_sqlbody(), process_integer_literal(), process_psqlrc(), ProcessConfigFileInternal(), ProcessParallelApplyMessage(), ProcessParallelMessage(), ProcessPgArchInterrupts(), ProcessStandbyHSFeedbackMessage(), ProcessStandbyReplyMessage(), ProcessStartupPacket(), ProcessWalSndrMessage(), prsd_headline(), prsd_lextype(), pset_value_string(), px_find_combo(), QueueFKConstraintValidation(), QueueNNConstraintValidation(), range_deparse(), read_client_final_message(), read_client_first_message(), read_dictionary(), read_tablespace_map(), RebuildConstraintComment(), record_config_file_error(), regclassout(), regcollationout(), regconfigout(), regdatabaseout(), regdictionaryout(), register_label_provider(), regnamespaceout(), regoperatorout(), regoperout(), regprocedureout(), regprocout(), REGRESS_exec_check_perms(), REGRESS_object_access_hook_str(), REGRESS_utility_command(), regroleout(), regtypeout(), ReindexPartitions(), RelationBuildTriggers(), RelationGetNotNullConstraints(), RemoveInheritance(), ReorderBufferFinishPrepared(), ReorderBufferPrepare(), ReorderBufferQueueMessage(), replace_auto_config_value(), ReplicationSlotRelease(), ReThrowError(), rewriteTargetListIU(), rewriteTargetView(), rmtree(), scram_exchange(), sendDir(), sepgsql_avc_compute(), sepgsql_compute_create(), sepgsql_get_label(), sepgsql_mcstrans_in(), sepgsql_mcstrans_out(), sepgsql_set_client_label(), set_relation_column_names(), set_stream_options(), shell_archive_file(), shell_get_sink(), show_sort_group_keys(), ShowGUCOption(), slotsync_reread_config(), SPI_fname(), SPI_getrelname(), SPI_gettype(), SplitDirectoriesString(), splitTzLine(), StartupRereadConfig(), stringToQualifiedNameList(), strip_trailing_ws(), substitute_path_macro(), SysLoggerMain(), 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_auth_file(), tokenize_expand_file(), transformFkeyGetPrimaryKey(), transformIndexConstraint(), transformJsonArrayQueryConstructor(), transformJsonTableColumn(), transformJsonTableColumns(), transformRangeTableFunc(), transformRowExpr(), transformSetOperationStmt(), transformTableLikeClause(), tsearch_readline(), typeTypeName(), unknownin(), unknownout(), utf_e2u(), utf_u2e(), validate_token(), verify_plain_backup_directory(), void_out(), wait_result_to_str(), worker_spi_main(), and X509_NAME_to_cstring().

◆ pvsnprintf()

char size_t pvsnprintf ( char buf,
size_t  len,
const char fmt,
va_list  args 
)
extern

◆ repalloc()

pg_nodiscard void * repalloc ( void pointer,
Size  size 
)
extern

Definition at line 1632 of file mcxt.c.

1633{
1634#if defined(USE_ASSERT_CHECKING) || defined(USE_VALGRIND)
1635 MemoryContext context = GetMemoryChunkContext(pointer);
1636#endif
1637 void *ret;
1638
1640
1641 /* isReset must be false already */
1642 Assert(!context->isReset);
1643
1644 /*
1645 * For efficiency reasons, we purposefully offload the handling of
1646 * allocation failures to the MemoryContextMethods implementation as this
1647 * allows these checks to be performed only when an actual malloc needs to
1648 * be done to request more memory from the OS. Additionally, not having
1649 * to execute any instructions after this call allows the compiler to use
1650 * the sibling call optimization. If you're considering adding code after
1651 * this call, consider making it the responsibility of the 'realloc'
1652 * function instead.
1653 */
1654 ret = MCXT_METHOD(pointer, realloc) (pointer, size, 0);
1655
1656 VALGRIND_MEMPOOL_CHANGE(context, pointer, ret, size);
1657
1658 return ret;
1659}
#define VALGRIND_MEMPOOL_CHANGE(context, optr, nptr, size)
Definition memdebug.h:31
#define realloc(a, b)

References Assert, AssertNotInCriticalSection, GetMemoryChunkContext(), MemoryContextData::isReset, MCXT_METHOD, pg_realloc(), realloc, and VALGRIND_MEMPOOL_CHANGE.

Referenced by _bt_deadblocks(), _bt_pendingfsm_add(), _bt_preprocess_keys(), _fdvec_resize(), accumArrayResult(), accumArrayResultArr(), add_column_to_pathtarget(), add_exact_object_address(), add_exact_object_address_extra(), add_object_address(), add_reloption(), addCompiledLexeme(), addCompoundAffixFlagValue(), AddInvalidationMessage(), addlit(), addlitchar(), AddStem(), addToArray(), AfterTriggerBeginSubXact(), AfterTriggerEnlargeQueryState(), appendElement(), appendKey(), apply_spooled_messages(), array_agg_array_combine(), array_agg_combine(), array_set_element_expanded(), AtSubCommit_childXids(), BlockRefTableEntryMarkBlockModified(), bms_add_member(), bms_add_range(), bms_replace_members(), brin_copy_tuple(), BufferSync(), BufFileAppend(), checkSharedDependencies(), compileTheLexeme(), compileTheSubstitute(), CopyReadAttributesCSV(), CopyReadAttributesText(), core_yyrealloc(), count_usable_fds(), cube_inter(), do_set_block_offsets(), dsnowball_lexize(), dxsyn_lexize(), enlarge_list(), enlargeStringInfo(), enum_range_internal(), ExecIndexBuildScanKeys(), ExecInitPartitionDispatchInfo(), ExecInitRoutingInfo(), ExprEvalPushStep(), extendBufFile(), find_inheritance_children_extended(), find_plan(), findDependentObjects(), generate_dependencies_recurse(), generateHeadline(), get_docrep(), GetComboCommandId(), GetConfFilesInDir(), GetExplainExtensionId(), GetLockStatusData(), GetPlannerExtensionId(), GetSingleProcBlockerStatusData(), GinBufferStoreTuple(), GinFormTuple(), ginPostingListDecodeAllSegments(), gistAddLoadedBuffer(), gistBuffersReleaseBlock(), gistGetNodeBuffer(), gtsvector_compress(), hladdword(), hlfinditem(), icu_language_tag(), int2vectorin(), jsonpath_yyrealloc(), load_domaintype_info(), load_enum_cache_data(), load_relcache_init_file(), LockAcquireExtended(), lookup_type_cache(), ltree_prefix_eq_ci(), ltsGetPreallocBlock(), ltsReleaseBlock(), mark_hl_fragments(), MergeAffix(), multirange_in(), NIAddAffix(), NIAddSpell(), NISortAffixes(), oidvectorin(), oidvectortypes(), okeys_object_field_start(), parse_hstore(), parsetext(), perform_default_encoding_conversion(), pg_do_encoding_conversion(), pg_import_system_collations(), pgss_shmem_startup(), plainnode(), plpgsql_adddatum(), prepare_room(), PrescanPreparedTransactions(), prs_setup_firstcall(), pushval_asis(), pushValue(), record_corrupt_item(), RecordConstLocation(), RegisterExtensionExplainOption(), RelationBuildDesc(), RelationBuildRuleLock(), RelationBuildTriggers(), RememberToFreeTupleDescAtEOX(), ReorderBufferAccumulateInvalidations(), ReorderBufferSerializeReserve(), repalloc0(), RequestNamedLWLockTranche(), resize_intArrayType(), resizeString(), rmtree(), SetConstraintStateAddItem(), setup_regexp_matches(), setup_test_matches(), SnapBuildAddCommittedTxn(), socket_putmessage_noblock(), SPI_connect_ext(), SPI_repalloc(), statext_dependencies_build(), statext_dependencies_deserialize(), statext_mcv_deserialize(), str_casefold(), str_initcap(), str_tolower(), str_toupper(), str_udeescape(), subxact_info_add(), TidListEval(), tsqueryrecv(), tsvectorin(), tsvectorrecv(), tuplestore_alloc_read_pointer(), uniqueentry(), varstr_abbrev_convert(), varstrfastcmp_locale(), XLogEnsureRecordSpace(), and yyrealloc().

◆ repalloc0()

pg_nodiscard void * repalloc0 ( void pointer,
Size  oldsize,
Size  size 
)
extern

Definition at line 1704 of file mcxt.c.

1705{
1706 void *ret;
1707
1708 /* catch wrong argument order */
1709 if (unlikely(oldsize > size))
1710 elog(ERROR, "invalid repalloc0 call: oldsize %zu, new size %zu",
1711 oldsize, size);
1712
1713 ret = repalloc(pointer, size);
1714 memset((char *) ret + oldsize, 0, (size - oldsize));
1715 return ret;
1716}
void * repalloc(void *pointer, Size size)
Definition mcxt.c:1632

References elog, ERROR, fb(), repalloc(), and unlikely.

Referenced by grow_notnull_info().

◆ repalloc_extended()

pg_nodiscard void * repalloc_extended ( void pointer,
Size  size,
int  flags 
)
extern

Definition at line 1667 of file mcxt.c.

1668{
1669#if defined(USE_ASSERT_CHECKING) || defined(USE_VALGRIND)
1670 MemoryContext context = GetMemoryChunkContext(pointer);
1671#endif
1672 void *ret;
1673
1675
1676 /* isReset must be false already */
1677 Assert(!context->isReset);
1678
1679 /*
1680 * For efficiency reasons, we purposefully offload the handling of
1681 * allocation failures to the MemoryContextMethods implementation as this
1682 * allows these checks to be performed only when an actual malloc needs to
1683 * be done to request more memory from the OS. Additionally, not having
1684 * to execute any instructions after this call allows the compiler to use
1685 * the sibling call optimization. If you're considering adding code after
1686 * this call, consider making it the responsibility of the 'realloc'
1687 * function instead.
1688 */
1689 ret = MCXT_METHOD(pointer, realloc) (pointer, size, flags);
1690 if (unlikely(ret == NULL))
1691 return NULL;
1692
1693 VALGRIND_MEMPOOL_CHANGE(context, pointer, ret, size);
1694
1695 return ret;
1696}

References Assert, AssertNotInCriticalSection, fb(), GetMemoryChunkContext(), MemoryContextData::isReset, MCXT_METHOD, realloc, unlikely, and VALGRIND_MEMPOOL_CHANGE.

Referenced by guc_realloc(), and repalloc_huge().

◆ repalloc_huge()

pg_nodiscard void * repalloc_huge ( void pointer,
Size  size 
)
extern

Definition at line 1757 of file mcxt.c.

1758{
1759 /* this one seems not worth its own implementation */
1760 return repalloc_extended(pointer, size, MCXT_ALLOC_HUGE);
1761}
void * repalloc_extended(void *pointer, Size size, int flags)
Definition mcxt.c:1667

References MCXT_ALLOC_HUGE, and repalloc_extended().

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

Variable Documentation

◆ CurrentMemoryContext

PGDLLIMPORT MemoryContext CurrentMemoryContext
extern

Definition at line 160 of file mcxt.c.

Referenced by _brin_parallel_merge(), _bt_load(), _bt_preprocess_array_keys(), _gin_parallel_build_main(), _hash_finish_split(), _SPI_commit(), _SPI_rollback(), _SPI_save_plan(), advance_windowaggregate(), advance_windowaggregate_base(), afterTriggerInvokeEvents(), AllocateSnapshotBuilder(), array_agg_array_deserialize(), array_agg_array_finalfn(), array_agg_deserialize(), array_agg_finalfn(), array_positions(), array_sort_internal(), array_to_datum_internal(), AtStart_Memory(), AtSubStart_Memory(), AttachPartitionEnsureIndexes(), autovacuum_do_vac_analyze(), be_lo_export(), be_lo_from_bytea(), be_lo_put(), 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_colinfo_names_hash(), build_join_rel_hash(), BuildCachedPlan(), BuildParamLogString(), BuildRelationExtStatistics(), CheckForSessionAndXactLocks(), CloneRowTriggersToPartition(), CompactCheckpointerRequestQueue(), compactify_ranges(), CompleteCachedPlan(), compute_array_stats(), compute_expr_stats(), compute_scalar_stats(), compute_tsvector_stats(), ComputeExtStatisticsRows(), CopyCachedPlan(), CopyErrorData(), CopyFrom(), CopyFromTextLikeOneRow(), create_toast_table(), CreateCachedPlan(), CreateEmptyBlockRefTable(), CreateExecutorState(), CreateOneShotCachedPlan(), CreatePartitionPruneState(), CreateStandaloneExprContext(), createTempGistContext(), createTrgmNFA(), CreateTriggerFiringOn(), daitch_mokotoff(), daitch_mokotoff_coding(), DatumGetExpandedArray(), DatumGetExpandedArrayX(), DatumGetExpandedRecord(), datumTransfer(), dblink_get_connections(), DiscreteKnapsack(), do_analyze_rel(), do_start_worker(), DoCopyTo(), domain_check_internal(), dsnowball_init(), each_worker(), each_worker_jsonb(), elements_worker(), elements_worker_jsonb(), ensure_free_space_in_buffer(), eqjoinsel_find_matches(), errsave_start(), EventTriggerInvoke(), examine_expression(), exec_replication_command(), exec_stmt_block(), ExecAggCopyTransValue(), ExecEvalHashedScalarArrayOp(), ExecHashTableCreate(), ExecInitCoerceToDomain(), ExecInitFunctionScan(), ExecInitGatherMerge(), ExecInitIndexScan(), ExecInitMemoize(), ExecInitMergeAppend(), ExecInitModifyTable(), ExecInitProjectSet(), ExecInitRecursiveUnion(), ExecInitSetOp(), ExecInitSubPlan(), ExecInitTableFuncScan(), ExecInitWindowAgg(), ExecMakeTableFunctionResult(), ExecScanSubPlan(), ExecSetParamPlan(), ExecSetupPartitionTupleRouting(), execute_sql_string(), ExecuteTruncateGuts(), ExplainExecuteQuery(), fetch_array_arg_replace_nulls(), file_acquire_sample_rows(), fileIterateForeignScan(), fill_hba_view(), fill_ident_view(), find_all_inheritors(), find_or_create_child_node(), find_partition_scheme(), fmgr_info(), fmgr_info_other_lang(), geqo_eval(), get_actual_variable_range(), get_database_list(), get_json_object_as_hash(), get_relation_notnullatts(), get_subscription_list(), GetCachedExpression(), GetConnection(), GetErrorContextStack(), GetWALRecordsInfo(), GetXLogSummaryStats(), gin_check_parent_keys_consistency(), gin_check_posting_tree_parent_keys_consistency(), gin_extract_query_trgm(), gin_xlog_startup(), ginbeginscan(), GinBufferInit(), ginbuild(), ginbulkdelete(), gininsert(), ginInsertCleanup(), ginPlaceToPage(), gistbuild(), gistInitBuildBuffers(), gistInitParentMap(), gistvacuumscan(), IdentifySystem(), index_form_tuple(), initBloomState(), initGinState(), initGISTstate(), initialize_brin_buildstate(), initialize_peragg(), InitPartitionPruneContext(), initTrie(), inline_function(), inline_function_in_from(), intset_create(), json_unique_builder_init(), json_unique_check_init(), JsonTableInitOpaque(), libpqrcv_processTuples(), libpqsrv_PQwrap(), lo_get_fragment_internal(), lo_import_internal(), load_domaintype_info(), load_tzoffsets(), load_validator_library(), LogicalParallelApplyLoop(), makeIndexInfo(), makeNumericAggStateCurrentContext(), MakeTupleTableSlot(), materializeQueryResult(), MemoryContextDeleteOnly(), MemoryContextInit(), MemoryContextSwitchTo(), MJExamineQuals(), multi_sort_add_dimension(), NextCopyFrom(), open_auth_file(), optionListToArray(), palloc(), palloc0(), palloc_aligned(), palloc_extended(), ParallelWorkerMain(), parse_ident(), perform_default_encoding_conversion(), perform_work_item(), pg_buffercache_os_pages_internal(), pg_buffercache_pages(), pg_do_encoding_conversion(), pg_get_backend_memory_contexts(), pg_get_logical_snapshot_info(), pg_get_logical_snapshot_meta(), pg_get_statisticsobjdef_expressions(), pg_get_wal_block_info(), pg_stats_ext_mcvlist_items(), 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_callback(), plpgsql_compile_inline(), plpgsql_estate_setup(), plpgsql_inline_handler(), plpgsql_validator(), plpython3_inline_handler(), pltcl_commit(), pltcl_elog(), pltcl_returnnext(), pltcl_rollback(), pltcl_SPI_execute(), pltcl_SPI_execute_plan(), pltcl_SPI_prepare(), pltcl_subtransaction(), PLy_commit(), PLy_cursor_fetch(), PLy_cursor_iternext(), PLy_cursor_plan(), PLy_cursor_query(), PLy_output(), PLy_rollback(), PLy_spi_execute_fetch_result(), PLy_spi_execute_plan(), PLy_spi_execute_query(), PLy_spi_prepare(), PLy_subtransaction_enter(), PLySequence_ToArray(), PLySequence_ToArray_recurse(), populate_array(), populate_recordset_object_start(), PortalRun(), PortalRunMulti(), postgresAcquireSampleRowsFunc(), postquel_start(), pq_parse_errornotice(), preparePresortedCols(), printtup_startup(), ProcessConfigFile(), prune_append_rel_partitions(), pstrdup(), publicationListToArray(), pull_up_simple_subquery(), pushJsonbValueScalar(), pushState(), RE_compile_and_cache(), regexp_split_to_array(), RelationBuildDesc(), RelationBuildRowSecurity(), ReorderBufferAllocate(), ReorderBufferImmediateInvalidation(), ReorderBufferProcessTXN(), ResetUnloggedRelations(), ResetUnloggedRelationsInDbspaceDir(), RevalidateCachedQuery(), ScanKeyEntryInitializeWithInfo(), serialize_expr_stats(), serializeAnalyzeStartup(), SerializePendingSyncs(), set_relation_partition_info(), set_rtable_names(), shdepReassignOwned(), shm_mq_attach(), smgr_bulk_start_smgr(), spg_xlog_startup(), spgbeginscan(), spgbuild(), spginsert(), spi_dest_startup(), split_text_accum_result(), sql_compile_callback(), standard_ExplainOneQuery(), startScanKey(), StartupDecodingContext(), statext_dependencies_build(), statext_mcv_serialize(), strlist_to_textarray(), sts_attach(), sts_initialize(), subquery_planner(), tbm_create(), test_basic(), test_empty(), test_enc_conversion(), test_pattern(), test_random(), text_to_array(), TidStoreCreateLocal(), tokenize_auth_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_gin(), tuplesort_begin_index_gist(), tuplestore_begin_common(), union_tuples(), UploadManifest(), validateForeignKeyConstraint(), write_console(), and xpath().