PostgreSQL Source Code
git master
|
#include "nodes/memnodes.h"
Go to the source code of this file.
#define AllocHugeSizeIsValid | ( | size | ) | ((Size) (size) <= MaxAllocHugeSize) |
Definition at line 46 of file memutils.h.
Referenced by AllocSetContextCreateInternal(), dsa_allocate_extended(), GenerationContextCreate(), MemoryContextAllocExtended(), MemoryContextAllocHuge(), palloc_extended(), and repalloc_huge().
#define ALLOCSET_DEFAULT_INITSIZE (8 * 1024) |
Definition at line 193 of file memutils.h.
Referenced by AllocSetContextCreateInternal(), CreateWorkExprContext(), and get_agg_clause_costs().
#define ALLOCSET_DEFAULT_MAXSIZE (8 * 1024 * 1024) |
Definition at line 194 of file memutils.h.
Referenced by CreateWorkExprContext().
#define ALLOCSET_DEFAULT_MINSIZE 0 |
Definition at line 192 of file memutils.h.
Referenced by AllocSetContextCreateInternal(), and CreateWorkExprContext().
#define ALLOCSET_DEFAULT_SIZES ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE |
Definition at line 195 of file memutils.h.
Referenced by afterTriggerAddEvent(), afterTriggerInvokeEvents(), AllocateSnapshotBuilder(), ApplyLauncherMain(), ApplyWorkerMain(), AtStart_Memory(), AtSubStart_Memory(), AttachPartitionEnsureIndexes(), AutoVacLauncherMain(), BackgroundWriterMain(), begin_heap_rewrite(), BeginCopyFrom(), BeginCopyTo(), blbuild(), blinsert(), brin_minmax_multi_union(), brin_new_memtuple(), bringetbitmap(), brininsert(), bt_check_every_level(), btree_xlog_startup(), btvacuumscan(), BuildEventTriggerCache(), BuildParamLogString(), BuildRelationExtStatistics(), CheckpointerMain(), cluster(), compactify_ranges(), compute_expr_stats(), compute_index_stats(), ComputeExtStatisticsRows(), CreateCacheMemoryContext(), CreateExecutorState(), CreateExprContext(), CreateStandaloneExprContext(), createTempGistContext(), createTrgmNFA(), do_analyze_rel(), do_autovacuum(), do_compile(), do_start_worker(), DoCopyTo(), each_worker(), each_worker_jsonb(), elements_worker(), elements_worker_jsonb(), EnablePortalManager(), ensure_free_space_in_buffer(), EventTriggerBeginCompleteQuery(), EventTriggerInvoke(), exec_parse_message(), exec_replication_command(), exec_simple_query(), ExecCreatePartitionPruneState(), ExecHashTableCreate(), ExecInitAgg(), ExecInitFunctionScan(), ExecInitProjectSet(), ExecInitRecursiveUnion(), ExecInitResultCache(), ExecInitSetOp(), ExecInitSubPlan(), ExecInitTableFuncScan(), ExecInitWindowAgg(), execute_sql_string(), file_acquire_sample_rows(), geqo_eval(), get_actual_variable_range(), get_stmt_mcontext(), GetLocalBufferStorage(), gin_xlog_startup(), ginbeginscan(), ginbuild(), ginbulkdelete(), gininsert(), ginInsertCleanup(), ginPlaceToPage(), gistrescan(), HandleParallelMessages(), hash_create(), index_register(), init_sql_fcache(), initArrayResult(), initArrayResultArr(), initGISTstate(), initialize_peragg(), InitSync(), InitXLogInsert(), inline_function(), inline_set_returning_function(), libpqrcv_processTuples(), logicalrep_partmap_init(), logicalrep_relmap_init(), LogicalRepApplyLoop(), make_expanded_record_from_datum(), make_expanded_record_from_exprecord(), make_expanded_record_from_tupdesc(), make_expanded_record_from_typeid(), mdinit(), MemoryContextInit(), NIStartBuild(), ParallelWorkerMain(), PerformAuthentication(), pg_decode_startup(), pgoutput_startup(), plperl_return_next_internal(), plperl_spi_prepare(), plpgsql_compile_inline(), plpgsql_estate_setup(), plpython_inline_handler(), PLy_cursor_plan(), PLy_cursor_query(), PLy_get_scratch_context(), PLy_procedure_create(), PLy_spi_execute_fetch_result(), PLy_spi_prepare(), PortalCreateHoldStore(), postgresBeginForeignScan(), PostgresMain(), PostmasterMain(), printtup_startup(), publicationListToArray(), rebuild_database_list(), ReindexPartitions(), RelationBuildDesc(), ReorderBufferAllocate(), ResetUnloggedRelations(), sepgsql_avc_init(), spg_xlog_startup(), spgbeginscan(), spgbuild(), spginsert(), SPI_connect_ext(), spi_dest_startup(), StartupDecodingContext(), strlist_to_textarray(), tuplesort_begin_batch(), tuplesort_begin_common(), union_tuples(), vacuum(), WalWriterMain(), XLOGShmemInit(), and xml_is_document().
#define ALLOCSET_SEPARATE_THRESHOLD 8192 |
Definition at line 222 of file memutils.h.
Referenced by AllocSetContextCreateInternal(), and tuplestore_begin_common().
#define ALLOCSET_SMALL_INITSIZE (1 * 1024) |
Definition at line 203 of file memutils.h.
Referenced by AllocSetContextCreateInternal(), and get_agg_clause_costs().
#define ALLOCSET_SMALL_MAXSIZE (8 * 1024) |
Definition at line 204 of file memutils.h.
#define ALLOCSET_SMALL_MINSIZE 0 |
Definition at line 202 of file memutils.h.
Referenced by AllocSetContextCreateInternal().
#define ALLOCSET_SMALL_SIZES ALLOCSET_SMALL_MINSIZE, ALLOCSET_SMALL_INITSIZE, ALLOCSET_SMALL_MAXSIZE |
Definition at line 205 of file memutils.h.
Referenced by _bt_preprocess_array_keys(), _SPI_make_plan_non_temp(), _SPI_save_plan(), brin_build_desc(), CloneRowTriggersToPartition(), compile_plperl_function(), compile_pltcl_function(), create_foreign_modify(), CreatePortal(), CreateTrigger(), DiscreteKnapsack(), ExecInitSubPlan(), fill_hba_view(), generate_partition_qual(), get_short_term_cxt(), GetCachedExpression(), init_MultiFuncCall(), load_domaintype_info(), load_hba(), load_ident(), load_relcache_init_file(), load_tzoffsets(), lookup_ts_dictionary_cache(), mXactCachePut(), pgstat_setup_backend_status_context(), pgstat_setup_memcxt(), plperl_spi_prepare(), plsample_func_handler(), pltcl_SPI_prepare(), postgresAcquireSampleRowsFunc(), postgresBeginDirectModify(), postgresBeginForeignScan(), ReindexMultipleTables(), ReindexRelationConcurrently(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationBuildRowSecurity(), RelationBuildRuleLock(), RelationInitIndexAccessInfo(), test_pattern(), tokenize_file(), and validateForeignKeyConstraint().
#define ALLOCSET_START_SMALL_SIZES ALLOCSET_SMALL_MINSIZE, ALLOCSET_SMALL_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE |
Definition at line 212 of file memutils.h.
Referenced by BuildCachedPlan(), CompleteCachedPlan(), CopyCachedPlan(), CreateCachedPlan(), expand_array(), and RevalidateCachedQuery().
#define AllocSetContextCreate AllocSetContextCreateInternal |
Definition at line 173 of file memutils.h.
Referenced by _bt_preprocess_array_keys(), _SPI_make_plan_non_temp(), _SPI_save_plan(), afterTriggerAddEvent(), afterTriggerInvokeEvents(), AllocateSnapshotBuilder(), ApplyLauncherMain(), ApplyWorkerMain(), AtStart_Memory(), AtSubStart_Memory(), AttachPartitionEnsureIndexes(), AutoVacLauncherMain(), BackgroundWriterMain(), begin_heap_rewrite(), BeginCopyFrom(), BeginCopyTo(), blbuild(), blinsert(), brin_build_desc(), brin_minmax_multi_union(), brin_new_memtuple(), bringetbitmap(), brininsert(), bt_check_every_level(), btree_xlog_startup(), btvacuumscan(), BuildCachedPlan(), BuildEventTriggerCache(), BuildParamLogString(), BuildRelationExtStatistics(), CheckpointerMain(), CloneRowTriggersToPartition(), cluster(), compactify_ranges(), compile_plperl_function(), compile_pltcl_function(), CompleteCachedPlan(), compute_expr_stats(), compute_index_stats(), ComputeExtStatisticsRows(), CopyCachedPlan(), create_foreign_modify(), CreateCachedPlan(), CreateCacheMemoryContext(), CreateExecutorState(), CreateExprContextInternal(), CreatePortal(), CreateStandaloneExprContext(), createTempGistContext(), createTrgmNFA(), CreateTrigger(), DiscreteKnapsack(), do_analyze_rel(), do_autovacuum(), do_compile(), do_start_worker(), DoCopyTo(), each_worker(), each_worker_jsonb(), elements_worker(), elements_worker_jsonb(), EnablePortalManager(), ensure_free_space_in_buffer(), EventTriggerBeginCompleteQuery(), EventTriggerInvoke(), exec_parse_message(), exec_replication_command(), exec_simple_query(), ExecCreatePartitionPruneState(), ExecHashTableCreate(), ExecInitAgg(), ExecInitFunctionScan(), ExecInitProjectSet(), ExecInitRecursiveUnion(), ExecInitResultCache(), ExecInitSetOp(), ExecInitSubPlan(), ExecInitTableFuncScan(), ExecInitWindowAgg(), execute_sql_string(), expand_array(), file_acquire_sample_rows(), fill_hba_view(), generate_partition_qual(), geqo_eval(), get_actual_variable_range(), get_short_term_cxt(), get_stmt_mcontext(), GetCachedExpression(), GetLocalBufferStorage(), gin_xlog_startup(), ginbeginscan(), ginbuild(), ginbulkdelete(), gininsert(), ginInsertCleanup(), ginPlaceToPage(), gistrescan(), HandleParallelMessages(), hash_create(), index_register(), init_MultiFuncCall(), init_sql_fcache(), initArrayResult(), initArrayResultArr(), initGISTstate(), initialize_peragg(), InitSync(), InitXLogInsert(), inline_function(), inline_set_returning_function(), libpqrcv_processTuples(), load_domaintype_info(), load_hba(), load_ident(), load_relcache_init_file(), load_tzoffsets(), logicalrep_partmap_init(), logicalrep_relmap_init(), LogicalRepApplyLoop(), lookup_ts_dictionary_cache(), make_expanded_record_from_datum(), make_expanded_record_from_exprecord(), make_expanded_record_from_tupdesc(), make_expanded_record_from_typeid(), mdinit(), MemoryContextInit(), mXactCachePut(), NIStartBuild(), ParallelWorkerMain(), PerformAuthentication(), pg_decode_startup(), pgoutput_startup(), pgstat_setup_backend_status_context(), pgstat_setup_memcxt(), plperl_return_next_internal(), plperl_spi_prepare(), plpgsql_compile_inline(), plpgsql_estate_setup(), plpython_inline_handler(), plsample_func_handler(), pltcl_SPI_prepare(), PLy_cursor_plan(), PLy_cursor_query(), PLy_get_scratch_context(), PLy_procedure_create(), PLy_spi_execute_fetch_result(), PLy_spi_prepare(), PortalCreateHoldStore(), postgresAcquireSampleRowsFunc(), postgresBeginDirectModify(), postgresBeginForeignScan(), PostgresMain(), PostmasterMain(), printtup_startup(), publicationListToArray(), rebuild_database_list(), ReindexMultipleTables(), ReindexPartitions(), ReindexRelationConcurrently(), RelationBuildDesc(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationBuildRowSecurity(), RelationBuildRuleLock(), RelationInitIndexAccessInfo(), ReorderBufferAllocate(), ResetUnloggedRelations(), RevalidateCachedQuery(), sepgsql_avc_init(), spg_xlog_startup(), spgbeginscan(), spgbuild(), spginsert(), SPI_connect_ext(), spi_dest_startup(), StartupDecodingContext(), strlist_to_textarray(), test_pattern(), tokenize_file(), tuplesort_begin_batch(), tuplesort_begin_common(), union_tuples(), vacuum(), validateForeignKeyConstraint(), WalWriterMain(), XLOGShmemInit(), and xml_is_document().
#define AllocSizeIsValid | ( | size | ) | ((Size) (size) <= MaxAllocSize) |
Definition at line 42 of file memutils.h.
Referenced by allocate_recordbuf(), array_fill_internal(), array_map(), array_replace_internal(), construct_md_array(), dsa_allocate_extended(), EA_get_flat_size(), MemoryContextAlloc(), MemoryContextAllocExtended(), MemoryContextAllocZero(), MemoryContextAllocZeroAligned(), palloc(), palloc0(), palloc_extended(), ReadArrayBinary(), ReadArrayStr(), and repalloc().
#define MaxAllocHugeSize (SIZE_MAX / 2) |
Definition at line 44 of file memutils.h.
Referenced by grow_memtuples(), perform_default_encoding_conversion(), pg_do_encoding_conversion(), and qtext_load_file().
#define MaxAllocSize ((Size) 0x3fffffff) /* 1 gigabyte - 1 */ |
Definition at line 40 of file memutils.h.
Referenced by _bt_pendingfsm_init(), array_fill_internal(), array_map(), array_replace_internal(), AtSubCommit_childXids(), binary_decode(), binary_encode(), byteaout(), compute_max_dead_tuples(), construct_md_array(), EA_get_flat_size(), EndPrepare(), enlargeStringInfo(), ExecChooseHashTableSize(), ExecHashIncreaseNumBatches(), ExecHashTableInsert(), ExecParallelHashIncreaseNumBatches(), ExecParallelHashTupleAlloc(), GetLocalBufferStorage(), ginHeapTupleFastCollect(), hstore_from_array(), hstore_from_arrays(), hstore_recv(), hstoreArrayToPairs(), lo_get_fragment_internal(), LogicalOutputWrite(), ltsConcatWorkerTapes(), ltsInitTape(), ltsReleaseBlock(), perform_default_encoding_conversion(), pg_do_encoding_conversion(), PLySequence_ToArray(), protect_out_of_mem(), pvsnprintf(), read_binary_file(), read_whole_file(), ReadArrayBinary(), ReadArrayStr(), ReadTwoPhaseFile(), setup_regexp_matches(), setup_test_matches(), shm_mq_receive(), shm_mq_sendv(), test_enc_conversion(), test_rb_tree(), tsqueryrecv(), tsvectorrecv(), varstr_abbrev_convert(), and varstrfastcmp_locale().
#define MemoryContextCopyAndSetIdentifier | ( | cxt, | |
id | |||
) | MemoryContextSetIdentifier(cxt, MemoryContextStrdup(cxt, id)) |
Definition at line 98 of file memutils.h.
Referenced by BuildCachedPlan(), generate_partition_qual(), load_relcache_init_file(), lookup_ts_dictionary_cache(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationBuildRowSecurity(), RelationBuildRuleLock(), and RelationInitIndexAccessInfo().
#define MemoryContextResetAndDeleteChildren | ( | ctx | ) | MemoryContextReset(ctx) |
Definition at line 67 of file memutils.h.
Referenced by _SPI_end_call(), AtCleanup_Memory(), AtEOSubXact_SPI(), AtSubCleanup_Memory(), AutoVacLauncherMain(), BackgroundWriterMain(), bringetbitmap(), brininsert(), BuildEventTriggerCache(), CheckpointerMain(), compute_expr_stats(), compute_index_stats(), do_analyze_rel(), do_autovacuum(), eval_windowaggregates(), ExecReScanRecursiveUnion(), ExecReScanSetOp(), FlushErrorState(), ginFreeScanKeys(), initialize_windowaggregate(), InvalidateEventCacheCallback(), LogicalRepApplyLoop(), perform_work_item(), PostgresMain(), release_partition(), and WalWriterMain().
#define SLAB_DEFAULT_BLOCK_SIZE (8 * 1024) |
Definition at line 224 of file memutils.h.
Referenced by ReorderBufferAllocate().
#define SLAB_LARGE_BLOCK_SIZE (8 * 1024 * 1024) |
Definition at line 225 of file memutils.h.
Referenced by ReorderBufferAllocate().
MemoryContext AllocSetContextCreateInternal | ( | MemoryContext | parent, |
const char * | name, | ||
Size | minContextSize, | ||
Size | initBlockSize, | ||
Size | maxBlockSize | ||
) |
Definition at line 379 of file aset.c.
References ALLOC_BLOCKHDRSZ, ALLOC_CHUNK_FRACTION, ALLOC_CHUNK_LIMIT, ALLOC_CHUNKHDRSZ, AllocHugeSizeIsValid, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_SEPARATE_THRESHOLD, ALLOCSET_SMALL_INITSIZE, ALLOCSET_SMALL_MINSIZE, AllocSetMethods, AllocBlockData::aset, Assert, AllocBlockData::endptr, ereport, errcode(), errdetail(), errmsg(), ERROR, AllocSetFreeList::first_free, AllocSetContext::freelist, AllocSetContext::freeListIndex, AllocBlockData::freeptr, AllocSetContext::header, AllocSetContext::initBlockSize, malloc, Max, MAXALIGN, AllocSetContext::maxBlockSize, MemoryContextCreate(), MemoryContextStats(), MemSetAligned, name, AllocBlockData::next, MemoryContextData::nextchild, AllocSetFreeList::num_free, offsetof, AllocBlockData::prev, StaticAssertStmt, T_AllocSetContext, TopMemoryContext, and VALGRIND_MAKE_MEM_NOACCESS.
Referenced by GetMemoryChunkContext().
MemoryContext GenerationContextCreate | ( | MemoryContext | parent, |
const char * | name, | ||
Size | blockSize | ||
) |
Definition at line 197 of file generation.c.
References AllocHugeSizeIsValid, GenerationContext::blockSize, dlist_init(), elog, ereport, errcode(), errdetail(), errmsg(), ERROR, Generation_CHUNKHDRSZ, malloc, MAXALIGN, MemoryContextCreate(), MemoryContextStats(), offsetof, StaticAssertStmt, T_GenerationContext, and TopMemoryContext.
Referenced by gistvacuumscan(), and ReorderBufferAllocate().
|
inlinestatic |
Definition at line 114 of file memutils.h.
References AllocSetContextCreateInternal(), Assert, AssertArg, HandleLogMemoryContextInterrupt(), MAXALIGN, MemoryContextCreate(), MemoryContextIsValid, name, and ProcessLogMemoryContextInterrupt().
Referenced by create_unique_path(), enlarge_list(), GetMemoryChunkSpace(), list_delete_nth_cell(), mark_dummy_rel(), pfree(), repalloc(), repalloc_huge(), and reparameterize_path_by_child().
Size GetMemoryChunkSpace | ( | void * | pointer | ) |
Definition at line 434 of file mcxt.c.
References MemoryContextMethods::get_chunk_space, GetMemoryChunkContext(), and MemoryContextData::methods.
Referenced by copytup_cluster(), copytup_heap(), free_sort_tuple(), getDatumCopy(), ginAllocEntryAccumulator(), ginCombineData(), ginInsertBAEntry(), grow_memtuples(), inittapestate(), intset_create(), intset_new_internal_node(), intset_new_leaf_node(), mergeruns(), readtup_heap(), tuplesort_begin_batch(), tuplesort_putdatum(), tuplesort_putindextuplevalues(), tuplestore_begin_common(), tuplestore_clear(), tuplestore_puttupleslot(), tuplestore_putvalues(), tuplestore_trim(), writetup_cluster(), writetup_datum(), writetup_heap(), and writetup_index().
void HandleLogMemoryContextInterrupt | ( | void | ) |
Definition at line 1024 of file mcxt.c.
References InterruptPending, and LogMemoryContextPending.
Referenced by GetMemoryChunkContext(), and procsignal_sigusr1_handler().
void MemoryContextAllowInCriticalSection | ( | MemoryContext | context, |
bool | allow | ||
) |
Definition at line 418 of file mcxt.c.
References MemoryContextData::allowInCritSection, AssertArg, and MemoryContextIsValid.
Referenced by InitSync(), MemoryContextInit(), and XLOGShmemInit().
bool MemoryContextContains | ( | MemoryContext | context, |
void * | pointer | ||
) |
Definition at line 758 of file mcxt.c.
References MAXALIGN.
Referenced by eval_windowfunction(), finalize_aggregate(), finalize_partialaggregate(), and finalize_windowaggregate().
void MemoryContextCreate | ( | MemoryContext | node, |
NodeTag | tag, | ||
const MemoryContextMethods * | methods, | ||
MemoryContext | parent, | ||
const char * | name | ||
) |
Definition at line 815 of file mcxt.c.
References MemoryContextData::allowInCritSection, Assert, CritSectionCount, MemoryContextData::firstchild, MemoryContextData::ident, MemoryContextData::isReset, MemoryContextData::mem_allocated, MemoryContextData::methods, MemoryContextData::name, name, MemoryContextData::nextchild, MemoryContextData::parent, MemoryContextData::prevchild, MemoryContextData::reset_cbs, MemoryContextData::type, and VALGRIND_CREATE_MEMPOOL.
Referenced by AllocSetContextCreateInternal(), GenerationContextCreate(), GetMemoryChunkContext(), and SlabContextCreate().
void MemoryContextDelete | ( | MemoryContext | context | ) |
Definition at line 218 of file mcxt.c.
References Assert, AssertArg, MemoryContextMethods::delete_context, MemoryContextData::firstchild, MemoryContextData::ident, MemoryContextCallResetCallbacks(), MemoryContextDeleteChildren(), MemoryContextIsValid, MemoryContextSetParent(), MemoryContextData::methods, and VALGRIND_DESTROY_MEMPOOL.
Referenced by AfterTriggerEndXact(), afterTriggerInvokeEvents(), ApplyLauncherMain(), AtCleanup_Memory(), AtCommit_Memory(), AtEOSubXact_SPI(), AtEOXact_LargeObject(), AtSubCleanup_Memory(), AtSubCommit_Memory(), AttachPartitionEnsureIndexes(), blbuild(), blinsert(), brin_free_desc(), brin_minmax_multi_union(), bringetbitmap(), brininsert(), bt_check_every_level(), btendscan(), btree_xlog_cleanup(), btvacuumscan(), BuildParamLogString(), BuildRelationExtStatistics(), CloneRowTriggersToPartition(), cluster(), compactify_ranges(), compile_plperl_function(), compile_pltcl_function(), compute_expr_stats(), compute_index_stats(), ComputeExtStatisticsRows(), createTrgmNFA(), CreateTrigger(), decr_dcc_refcount(), DeleteExpandedObject(), DiscreteKnapsack(), do_analyze_rel(), do_start_bgworker(), do_start_worker(), DoCopyTo(), DropCachedPlan(), each_worker(), each_worker_jsonb(), elements_worker(), elements_worker_jsonb(), end_heap_rewrite(), EndCopy(), EndCopyFrom(), ensure_free_space_in_buffer(), EventTriggerEndCompleteQuery(), EventTriggerInvoke(), exec_replication_command(), exec_simple_query(), ExecEndAgg(), ExecEndRecursiveUnion(), ExecEndResultCache(), ExecEndSetOp(), ExecEndWindowAgg(), ExecHashTableDestroy(), execute_sql_string(), file_acquire_sample_rows(), fill_hba_view(), fmgr_sql(), free_plperl_function(), FreeCachedExpression(), FreeDecodingContext(), FreeExecutorState(), FreeExprContext(), freeGISTstate(), FreeSnapshotBuilder(), geqo_eval(), get_actual_variable_range(), gin_xlog_cleanup(), ginbuild(), ginbulkdelete(), ginendscan(), gininsert(), ginInsertCleanup(), ginPlaceToPage(), gist_xlog_cleanup(), gistbuild(), gistvacuumscan(), hash_destroy(), inline_function(), inline_set_returning_function(), libpqrcv_processTuples(), load_hba(), load_ident(), load_tzoffsets(), makeArrayResultArr(), makeMdArrayResult(), MemoryContextDeleteChildren(), NIFinishBuild(), pg_decode_shutdown(), pgstat_clear_backend_activity_snapshot(), pgstat_clear_snapshot(), plperl_spi_freeplan(), plperl_spi_prepare(), plpgsql_free_function_memory(), pltcl_handler(), pltcl_SPI_prepare(), PLy_cursor_dealloc(), PLy_plan_dealloc(), PLy_pop_execution_context(), PLy_procedure_delete(), PLy_spi_execute_fetch_result(), PortalDrop(), PostgresMain(), printtup_shutdown(), publicationListToArray(), rebuild_database_list(), ReindexMultipleTables(), ReindexPartitions(), ReindexRelationConcurrently(), RelationBuildDesc(), RelationBuildRuleLock(), RelationDestroyRelation(), ReleaseCachedPlan(), ReorderBufferFree(), ResetUnloggedRelations(), RevalidateCachedQuery(), shutdown_MultiFuncCall(), spg_xlog_cleanup(), spgbuild(), spgendscan(), spginsert(), SPI_finish(), SPI_freeplan(), SPI_freetuptable(), StartChildProcess(), strlist_to_textarray(), test_pattern(), tokenize_inc_file(), tuplesort_end(), union_tuples(), vacuum(), and validateForeignKeyConstraint().
void MemoryContextDeleteChildren | ( | MemoryContext | context | ) |
Definition at line 263 of file mcxt.c.
References AssertArg, MemoryContextData::firstchild, MemoryContextDelete(), and MemoryContextIsValid.
Referenced by AtAbort_Portals(), AtSubAbort_Portals(), exec_stmt_block(), MemoryContextDelete(), MemoryContextReset(), PersistHoldablePortal(), PortalRunMulti(), and RelationClose().
MemoryContext MemoryContextGetParent | ( | MemoryContext | context | ) |
Definition at line 446 of file mcxt.c.
References AssertArg, MemoryContextIsValid, and MemoryContextData::parent.
Referenced by advance_windowaggregate(), advance_windowaggregate_base(), ExecAggTransReparent(), GetCachedPlan(), pop_stmt_mcontext(), and push_stmt_mcontext().
void MemoryContextInit | ( | void | ) |
Definition at line 99 of file mcxt.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, AssertState, MemoryContextAllowInCriticalSection(), and TopMemoryContext.
Referenced by main().
bool MemoryContextIsEmpty | ( | MemoryContext | context | ) |
Definition at line 458 of file mcxt.c.
References AssertArg, MemoryContextData::firstchild, MemoryContextMethods::is_empty, MemoryContextIsValid, and MemoryContextData::methods.
Referenced by AtSubCommit_Memory().
Size MemoryContextMemAllocated | ( | MemoryContext | context, |
bool | recurse | ||
) |
Definition at line 477 of file mcxt.c.
References AssertArg, MemoryContextData::firstchild, MemoryContextData::mem_allocated, MemoryContextIsValid, MemoryContextMemAllocated(), and MemoryContextData::nextchild.
Referenced by hash_agg_check_limits(), hash_agg_update_metrics(), and MemoryContextMemAllocated().
void MemoryContextReset | ( | MemoryContext | context | ) |
Definition at line 143 of file mcxt.c.
References AssertArg, MemoryContextData::firstchild, MemoryContextData::isReset, MemoryContextDeleteChildren(), MemoryContextIsValid, and MemoryContextResetOnly().
Referenced by _bt_preprocess_array_keys(), AfterTriggerExecute(), apply_handle_stream_commit(), apply_handle_stream_stop(), bloomBuildCallback(), brin_memtuple_initialize(), bt_check_level_from_leftmost(), btree_redo(), btvacuumpage(), buildSubPlanHash(), check_domain_for_new_field(), check_domain_for_new_tuple(), CloneRowTriggersToPartition(), CopyOneRowTo(), CreateTrigger(), dumptuples(), each_object_field_end(), each_worker_jsonb(), elements_array_element_end(), elements_worker_jsonb(), errstart(), EventTriggerInvoke(), exec_dynquery_with_params(), exec_stmt_block(), exec_stmt_dynexecute(), exec_stmt_forc(), exec_stmt_foreach_a(), exec_stmt_open(), exec_stmt_raise(), exec_stmt_return_query(), ExecFindInitialMatchingSubPlans(), ExecFindMatchingSubPlans(), ExecHashTableReset(), ExecMakeTableFunctionResult(), ExecProjectSet(), ExecQualAndReset(), ExecRecursiveUnion(), execTuplesUnequal(), execute_foreign_modify(), expanded_record_set_field_internal(), expanded_record_set_tuple(), fetch_more_data(), file_acquire_sample_rows(), get_short_term_cxt(), gin_redo(), ginBuildCallback(), ginHeapTupleBulkInsert(), ginInsertCleanup(), ginVacuumPostingTreeLeaves(), gist_indexsortbuild(), gist_redo(), gistBuildCallback(), gistgetbitmap(), gistgettuple(), gistinsert(), gistProcessEmptyingQueue(), gistrescan(), gistScanPage(), gistSortedBuildCallback(), HandleParallelMessages(), heapam_index_build_range_scan(), heapam_index_validate_scan(), IndexCheckExclusion(), keyGetItem(), libpqrcv_processTuples(), LogicalRepApplyLoop(), lookup_ts_dictionary_cache(), make_tuple_from_result_row(), pg_decode_change(), pg_decode_truncate(), pgoutput_change(), pgoutput_truncate(), plperl_return_next_internal(), PLy_input_convert(), PLy_input_from_tuple(), printtup(), process_ordered_aggregate_single(), ReScanExprContext(), resetSpGistScanOpaque(), scanPendingInsert(), sepgsql_avc_reset(), spg_redo(), spginsert(), spgistBuildCallback(), spgWalk(), startScanKey(), storeRow(), tfuncFetchRows(), tfuncLoadRows(), tuplesort_free(), and validateForeignKeyConstraint().
void MemoryContextResetChildren | ( | MemoryContext | context | ) |
Definition at line 195 of file mcxt.c.
References AssertArg, MemoryContextData::firstchild, MemoryContextIsValid, MemoryContextResetChildren(), MemoryContextResetOnly(), and MemoryContextData::nextchild.
Referenced by MemoryContextResetChildren().
void MemoryContextResetOnly | ( | MemoryContext | context | ) |
Definition at line 162 of file mcxt.c.
References AssertArg, MemoryContextData::isReset, MemoryContextCallResetCallbacks(), MemoryContextIsValid, MemoryContextData::methods, MemoryContextMethods::reset, VALGRIND_CREATE_MEMPOOL, and VALGRIND_DESTROY_MEMPOOL.
Referenced by AllocSetDelete(), MemoryContextReset(), MemoryContextResetChildren(), and mergeruns().
void MemoryContextSetIdentifier | ( | MemoryContext | context, |
const char * | id | ||
) |
Definition at line 336 of file mcxt.c.
References AssertArg, MemoryContextData::ident, and MemoryContextIsValid.
Referenced by compile_plperl_function(), compile_pltcl_function(), CopyCachedPlan(), CreateCachedPlan(), CreatePortal(), do_compile(), hash_create(), init_sql_fcache(), lookup_ts_dictionary_cache(), PLy_procedure_create(), and test_pattern().
void MemoryContextSetParent | ( | MemoryContext | context, |
MemoryContext | new_parent | ||
) |
Definition at line 361 of file mcxt.c.
References Assert, AssertArg, MemoryContextData::firstchild, MemoryContextIsValid, MemoryContextData::nextchild, MemoryContextData::parent, and MemoryContextData::prevchild.
Referenced by _SPI_save_plan(), CachedPlanSetParentContext(), CompleteCachedPlan(), exec_parse_message(), GetCachedExpression(), GetCachedPlan(), load_domaintype_info(), MemoryContextDelete(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationBuildRowSecurity(), RelationClearRelation(), RevalidateCachedQuery(), SaveCachedPlan(), SPI_keepplan(), and TransferExpandedObject().
void MemoryContextStats | ( | MemoryContext | context | ) |
Definition at line 505 of file mcxt.c.
References MemoryContextStatsDetail().
Referenced by AllocSetContextCreateInternal(), finish_xact_command(), GenerationContextCreate(), MemoryContextAlloc(), MemoryContextAllocExtended(), MemoryContextAllocHuge(), MemoryContextAllocZero(), MemoryContextAllocZeroAligned(), palloc(), palloc0(), palloc_extended(), repalloc(), repalloc_huge(), SlabContextCreate(), and test_pattern().
void MemoryContextStatsDetail | ( | MemoryContext | context, |
int | max_children, | ||
bool | print_to_stderr | ||
) |
Definition at line 520 of file mcxt.c.
References ereport, errhidecontext(), errhidestmt(), errmsg_internal(), fprintf, MemoryContextCounters::freechunks, MemoryContextCounters::freespace, LOG_SERVER_ONLY, MemoryContextStatsInternal(), MemoryContextCounters::nblocks, and MemoryContextCounters::totalspace.
Referenced by MemoryContextStats(), and ProcessLogMemoryContextInterrupt().
void ProcessLogMemoryContextInterrupt | ( | void | ) |
Definition at line 1041 of file mcxt.c.
References ereport, errmsg(), LOG, LogMemoryContextPending, MemoryContextStatsDetail(), and MyProcPid.
Referenced by GetMemoryChunkContext(), and ProcessInterrupts().
MemoryContext SlabContextCreate | ( | MemoryContext | parent, |
const char * | name, | ||
Size | blockSize, | ||
Size | chunkSize | ||
) |
Definition at line 175 of file slab.c.
References SlabContext::blockSize, SlabContext::chunkSize, SlabContext::chunksPerBlock, dlist_init(), elog, ereport, errcode(), errdetail(), errmsg(), ERROR, SlabContext::freelist, SlabContext::fullChunkSize, SlabContext::headerSize, i, malloc, MAXALIGN, MemoryContextCreate(), MemoryContextStats(), offsetof, StaticAssertStmt, T_SlabContext, and TopMemoryContext.
Referenced by ReorderBufferAllocate().
PGDLLIMPORT MemoryContext CacheMemoryContext |
Definition at line 51 of file mcxt.c.
Referenced by _SPI_save_plan(), AllocateRelationDesc(), assign_record_type_typmod(), AttrDefaultFetch(), BuildEventTriggerCache(), BuildHardcodedDescriptor(), CatalogCacheCreateEntry(), CatalogCacheInitializeCache(), CheckConstraintFetch(), CreateCacheMemoryContext(), ensure_record_cache_typmod_slot_exists(), generate_partition_qual(), get_attribute_options(), get_rel_sync_entry(), get_tablespace(), GetCachedExpression(), GetCachedPlan(), GetFdwRoutineForRelation(), GetRelationPublicationActions(), init_ts_config_cache(), InitCatCache(), InitializeAttoptCache(), InitializeRelfilenodeMap(), InitializeTableSpaceCache(), load_domaintype_info(), load_enum_cache_data(), load_rangetype_info(), load_relcache_init_file(), logicalrep_partmap_init(), logicalrep_relmap_init(), lookup_ts_config_cache(), lookup_ts_dictionary_cache(), lookup_ts_parser_cache(), lookup_type_cache(), LookupOpclassInfo(), maybe_send_schema(), pgoutput_startup(), process_syncing_tables_for_apply(), register_on_commit_action(), RehashCatCache(), RelationBuildLocalRelation(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), RelationBuildRowSecurity(), RelationBuildRuleLock(), RelationBuildTriggers(), RelationBuildTupleDesc(), RelationCacheInitialize(), RelationCacheInitializePhase2(), RelationCacheInitializePhase3(), RelationGetFKeyList(), RelationGetIndexAttrBitmap(), RelationGetIndexList(), RelationGetStatExtList(), RelationInitIndexAccessInfo(), RelationParseRelOptions(), RememberToFreeTupleDescAtEOX(), SaveCachedPlan(), SearchCatCacheList(), set_schema_sent_in_streamed_txn(), and SPI_keepplan().
PGDLLIMPORT MemoryContext CurTransactionContext |
Definition at line 54 of file mcxt.c.
Referenced by AddEventToPendingNotifies(), AddInvalidationMessage(), Async_Notify(), AtCleanup_Memory(), AtCommit_Memory(), AtStart_Memory(), AtSubCleanup_Memory(), AtSubCommit_Memory(), AtSubStart_Memory(), GetAfterTriggersStoreSlot(), GetAfterTriggersTableData(), GetCurrentFDWTuplestore(), MakeTransitionCaptureState(), NIStartBuild(), PopTransaction(), queue_listen(), RelationBuildPartitionDesc(), RelationBuildPartitionKey(), ReleaseCurrentSubTransaction(), sepgsql_set_client_label(), setup_background_workers(), StartTransactionCommand(), and xactGetCommittedInvalidationMessages().
PGDLLIMPORT MemoryContext ErrorContext |
Definition at line 49 of file mcxt.c.
Referenced by CopyErrorData(), errfinish(), errstart(), FlushErrorState(), format_elog_string(), and ReThrowError().
PGDLLIMPORT MemoryContext MessageContext |
Definition at line 52 of file mcxt.c.
Referenced by exec_bind_message(), exec_describe_portal_message(), exec_describe_statement_message(), exec_parse_message(), exec_simple_query(), and PostgresMain().
PGDLLIMPORT MemoryContext PortalContext |
Definition at line 57 of file mcxt.c.
Referenced by ATExecDetachPartition(), cluster(), do_autovacuum(), perform_work_item(), PersistHoldablePortal(), PLy_push_execution_context(), PortalRun(), PortalRunFetch(), PortalStart(), ReindexMultipleTables(), ReindexPartitions(), ReindexRelationConcurrently(), SPI_connect_ext(), and vacuum().
PGDLLIMPORT MemoryContext PostmasterContext |
Definition at line 50 of file mcxt.c.
Referenced by do_start_bgworker(), load_hba(), load_ident(), PerformAuthentication(), PostgresMain(), PostmasterMain(), and StartChildProcess().
PGDLLIMPORT MemoryContext TopMemoryContext |
Definition at line 48 of file mcxt.c.
Referenced by _PG_init(), add_reloption(), allocate_reloption(), AllocateAttribute(), AllocSetContextCreateInternal(), ApplyLauncherMain(), ApplyWorkerMain(), AtAbort_Memory(), AtCleanup_Memory(), AtCommit_Memory(), AtStart_Memory(), AttachSession(), AutoVacLauncherMain(), BackendRun(), BackgroundWriterMain(), be_tls_open_server(), cache_single_string(), check_foreign_key(), check_primary_key(), CheckpointerMain(), CheckSCRAMAuth(), ClientAuthentication(), compile_plperl_function(), compile_pltcl_function(), CreateCacheMemoryContext(), dblink_connect(), dblink_init(), DCH_cache_getnew(), do_autovacuum(), do_compile(), do_start_bgworker(), dsm_create_descriptor(), dsm_impl_sysv(), EnablePortalManager(), EventTriggerBeginCompleteQuery(), Exec_ListenCommit(), executeDateTimeMethod(), find_plan(), finish_xact_command(), GenerationContextCreate(), get_tabstat_entry(), GetLocalBufferStorage(), GetLockConflicts(), GetSessionDsmHandle(), HandleParallelMessages(), hash_create(), init_string_reloption(), InitDeadLockChecking(), initialize_reloptions(), InitializeClientEncoding(), InitializeLatchWaitSet(), InitializeParallelDSM(), InitializeSearchPath(), InitializeSession(), InitSync(), InitXLogInsert(), llvm_compile_module(), llvm_create_context(), llvm_session_initialize(), LockAcquireExtended(), LogicalRepApplyLoop(), LWLockRegisterTranche(), mdinit(), MemoryContextInit(), mxid_to_string(), NUM_cache_getnew(), on_dsm_detach(), PageSetChecksumCopy(), ParallelWorkerMain(), PerformAuthentication(), pg_get_backend_memory_contexts(), pg_newlocale_from_collation(), pg_start_backup(), pgstat_setup_backend_status_context(), pgstat_setup_memcxt(), plperl_spi_prepare(), plpgsql_estate_setup(), plpython_inline_handler(), plsample_func_handler(), pltcl_SPI_prepare(), PLy_cursor_plan(), PLy_cursor_query(), PLy_procedure_create(), PLy_spi_execute_fetch_result(), PLy_spi_prepare(), populate_typ_list(), PostgresMain(), PostmasterMain(), pq_init(), PrepareClientEncoding(), ProcessStartupPacket(), PushOverrideSearchPath(), px_find_cipher(), px_find_digest(), recomputeNamespacePath(), register_label_provider(), RegisterResourceReleaseCallback(), RegisterSubXactCallback(), RegisterXactCallback(), RelationCreateStorage(), RelationDropStorage(), RequestNamedLWLockTranche(), ResourceArrayEnlarge(), ResourceOwnerCreate(), RestoreReindexState(), ri_HashCompareOp(), roles_is_member_of(), secure_open_gssapi(), sepgsql_avc_init(), sepgsql_xact_callback(), set_authn_id(), SetDatabasePath(), SharedRecordTypmodRegistryAttach(), SharedRecordTypmodRegistryInit(), SlabContextCreate(), SPI_connect_ext(), StartChildProcess(), WalWriterMain(), XLOGShmemInit(), and xml_is_document().
PGDLLIMPORT MemoryContext TopTransactionContext |
Definition at line 53 of file mcxt.c.
Referenced by add_tabstat_xact_level(), AddPendingSync(), afterTriggerAddEvent(), AfterTriggerBeginSubXact(), AfterTriggerEnlargeQueryState(), apply_handle_stream_commit(), Async_Notify(), AtCleanup_Memory(), AtCommit_Memory(), AtStart_Memory(), AtSubCommit_childXids(), BeginInternalSubTransaction(), CopySnapshot(), CreateParallelContext(), DefineSavepoint(), ExportSnapshot(), get_tabstat_stack_level(), GetComboCommandId(), init_uncommitted_enums(), InitializeParallelDSM(), LaunchParallelWorkers(), make_tuple_indirect(), mXactCachePut(), plpgsql_create_econtext(), PLy_get_scratch_context(), PLy_push_execution_context(), PLy_subtransaction_enter(), PortalRun(), PrepareInvalidationState(), PrepareTempTablespaces(), PrepareTransactionBlock(), push_old_value(), PushActiveSnapshot(), PushTransaction(), queue_listen(), RestoreSnapshot(), SetConstraintStateCreate(), setup_background_workers(), and SPI_connect_ext().