PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
Go to the source code of this file.
Functions | |
static void * | pg_malloc_internal (size_t size, int flags) |
void * | pg_malloc (size_t size) |
void * | pg_malloc0 (size_t size) |
void * | pg_malloc_extended (size_t size, int flags) |
void * | pg_realloc (void *ptr, size_t size) |
char * | pg_strdup (const char *in) |
void | pg_free (void *ptr) |
void * | palloc (Size size) |
void * | palloc0 (Size size) |
void * | palloc_extended (Size size, int flags) |
void | pfree (void *pointer) |
char * | pstrdup (const char *in) |
char * | pnstrdup (const char *in, Size size) |
void * | repalloc (void *pointer, Size size) |
void* palloc | ( | Size | size | ) |
Definition at line 116 of file fe_memutils.c.
References MemoryContextMethods::alloc, AllocSizeIsValid, AssertArg, AssertNotInCriticalSection, CurrentMemoryContext, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, MemoryContextData::isReset, MemoryContextIsValid, MemoryContextStats(), MemoryContextData::methods, MemoryContextData::name, pg_malloc_internal(), unlikely, and VALGRIND_MEMPOOL_ALLOC.
void* palloc0 | ( | Size | size | ) |
Definition at line 122 of file fe_memutils.c.
References MemoryContextMethods::alloc, AllocSizeIsValid, AssertArg, AssertNotInCriticalSection, CurrentMemoryContext, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, MemoryContextData::isReset, MCXT_ALLOC_ZERO, MemoryContextIsValid, MemoryContextStats(), MemSetAligned, MemoryContextData::methods, MemoryContextData::name, pg_malloc_internal(), unlikely, and VALGRIND_MEMPOOL_ALLOC.
void* palloc_extended | ( | Size | size, |
int | flags | ||
) |
Definition at line 128 of file fe_memutils.c.
References MemoryContextMethods::alloc, AllocHugeSizeIsValid, AllocSizeIsValid, AssertArg, AssertNotInCriticalSection, CurrentMemoryContext, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, MemoryContextData::isReset, MCXT_ALLOC_HUGE, MCXT_ALLOC_NO_OOM, MCXT_ALLOC_ZERO, MemoryContextIsValid, MemoryContextStats(), MemSetAligned, MemoryContextData::methods, MemoryContextData::name, pg_malloc_internal(), unlikely, and VALGRIND_MEMPOOL_ALLOC.
void pfree | ( | void * | pointer | ) |
Definition at line 134 of file fe_memutils.c.
References MemoryContextMethods::free_p, GetMemoryChunkContext(), MemoryContextData::methods, pg_free(), and VALGRIND_MEMPOOL_FREE.
void pg_free | ( | void * | ptr | ) |
Definition at line 105 of file fe_memutils.c.
References free.
Referenced by append_depends_on_extension(), appendQualifiedRelation(), avlFree(), bool_substitute_hook(), calculate_totals(), copyFile(), create_script_for_old_cluster_deletion(), datapagemap_print(), dir_close(), do_connect(), do_watch(), dumpFunc(), equivalent_locale(), findCommonAncestorTimeline(), flagInhIndexes(), free_command(), free_db_and_rel_infos(), free_rel_infos(), free_socket_set(), FreeWalDirectoryMethod(), FreeWalTarMethod(), get_canonical_locale_name(), get_control_data(), get_loadable_libraries(), get_restricted_token(), getTimelineHistory(), init_libpq_conn(), libpq_get_current_wal_insert_lsn(), LogStreamerMain(), main(), makeAlterConfigCommand(), parallel_exec_prog(), parallel_transfer_all_new_dbs(), parseAclItem(), parseCommandLine(), parseQuery(), perform_rewind(), pfree(), printCrosstab(), PrintResultsInCrosstab(), process_queued_fetch_requests(), rankSort(), readCommandResponse(), readMessageFromPipe(), ready_list_free(), reindex_one_database(), RestoreArchive(), run_schedule(), SendQuery(), setalarm(), SetVariable(), simple_oid_list_destroy(), simple_string_list_destroy(), SortTocFromFile(), StreamLog(), tar_close(), tar_open_for_write(), transfer_all_new_dbs(), vacuum_one_database(), and WriteDataChunks().
void* pg_malloc | ( | size_t | size | ) |
Definition at line 47 of file fe_memutils.c.
References pg_malloc_internal().
Referenced by _Clone(), _CustomReadFunc(), _PrintFileData(), _skipData(), add_one_elt(), add_stringlist_item(), addObjectDependency(), ahprintf(), ArchiveEntry(), archprintf(), AssignDumpId(), avlInsertNode(), BuildArchiveDependencies(), buildIndexArray(), cfopen(), CloneArchive(), collectComments(), collectSecLabels(), conditional_stack_create(), conditional_stack_push(), copyFile(), create_sql_command(), createBoundaryObjects(), CreateVariableSpace(), CreateWalTarMethod(), datapagemap_iterate(), decide_file_actions(), do_connect(), do_watch(), EndCompressor(), escape_quotes_bki(), ExecuteSqlCommandBuf(), filter_lines_with_token(), find_other_exec_or_die(), findDependencyLoops(), findParentsByOid(), fix_dependencies(), flagInhAttrs(), format_numeric_locale(), gen_db_file_maps(), get_comma_elts(), get_db_infos(), get_loadable_libraries(), get_rel_infos(), get_tablespace_paths(), getAccessMethods(), getAggregates(), getBlobs(), getCasts(), getCollations(), getConstraints(), getConversions(), getDefaultACLs(), getDomainConstraints(), getDumpableObjects(), getEventTriggers(), getExtendedStatistics(), getExtensionMembership(), getExtensions(), getForeignDataWrappers(), getForeignServers(), getFuncs(), getIndexes(), getInherits(), getNamespaces(), getOpclasses(), getOperators(), getOpfamilies(), getPolicies(), getProcLangs(), getPublications(), getPublicationTables(), getRules(), getSubscriptions(), getTableAttrs(), getTimelineHistory(), getTransforms(), getTriggers(), getTSConfigurations(), getTSDictionaries(), getTSParsers(), getTSTemplates(), getTypes(), identify_locking_dependencies(), InitArchiveFmt_Custom(), InitArchiveFmt_Directory(), InitArchiveFmt_Null(), InitArchiveFmt_Tar(), initialize_environment(), libpq_fetch_file(), load_resultmap(), lookupCreateVariable(), main(), makeTableDataInfo(), NewDumpOptions(), parallel_exec_prog(), parallel_transfer_all_new_dbs(), ParallelBackupStart(), ParallelSlotsSetup(), parse_manifest_file(), ParseScript(), parseScriptWeight(), parseVariable(), pretty_wal_size(), print_aligned_text(), print_aligned_vertical(), printCrosstab(), PrintResultsInCrosstab(), process_queued_fetch_requests(), pset_quoted_string(), quote_identifier(), quote_if_needed(), rankSort(), read_controlfile(), read_file_contents(), ReadDataFromArchiveNone(), readfile(), readMessageFromPipe(), ReadStr(), ReadToc(), ready_list_init(), replace_token(), rewind_parseTimeLineHistory(), run_all_permutations(), run_named_permutations(), run_permutation(), savePsetInfo(), setup_bin_paths(), SetVariable(), SetVariableHooks(), simple_action_list_append(), simple_oid_list_append(), simple_ptr_list_append(), simple_string_list_append(), slurpFile(), socket_has_input(), sortDumpableObjects(), SplitGUCList(), sql_exec(), sql_exec_searchtables(), strtokx(), tar_open_for_write(), tarPrintf(), TopoSort(), wait_for_tests(), WaitForTerminatingWorkers(), and WriteDataChunks().
void* pg_malloc0 | ( | size_t | size | ) |
Definition at line 53 of file fe_memutils.c.
References MCXT_ALLOC_ZERO, and pg_malloc_internal().
Referenced by _allocAH(), _ArchiveEntry(), _discoverArchiveFormat(), _ReadExtraToc(), _tarPositionTo(), alloc_socket_set(), AllocateCompressor(), ArchiveEntry(), avlInit(), buildTocEntryArrays(), connectDatabase(), CreateWalDirectoryMethod(), CreateWalTarMethod(), describeRoles(), dir_open_for_write(), findDependencyLoops(), flagInhIndexes(), get_parallel_object_list(), GetConnection(), getFuncs(), getTables(), init_libpq_source(), init_local_source(), InitArchiveFmt_Custom(), InitArchiveFmt_Directory(), InitArchiveFmt_Tar(), main(), NewRestoreOptions(), parallel_exec_prog(), parallel_transfer_all_new_dbs(), ParallelBackupStart(), parse_slash_copy(), print_aligned_text(), printTableAddCell(), printTableAddFooter(), printTableInit(), process_backslash_command(), ReadToc(), reindex_one_database(), setalarm(), SortTocFromFile(), StartLogStreamer(), tablespace_list_append(), tar_open_for_write(), tarOpen(), and TopoSort().
void* pg_malloc_extended | ( | size_t | size, |
int | flags | ||
) |
Definition at line 59 of file fe_memutils.c.
References pg_malloc_internal().
Referenced by do_kill(), do_lo_import(), and pg_log_generic_v().
|
inlinestatic |
Definition at line 23 of file fe_memutils.c.
References _, EXIT_FAILURE, fprintf, malloc, MCXT_ALLOC_NO_OOM, MCXT_ALLOC_ZERO, and MemSet.
Referenced by palloc(), palloc0(), palloc_extended(), pg_malloc(), pg_malloc0(), and pg_malloc_extended().
void* pg_realloc | ( | void * | ptr, |
size_t | size | ||
) |
Definition at line 65 of file fe_memutils.c.
References _, EXIT_FAILURE, fprintf, and realloc.
Referenced by add_one_elt(), addObjectDependency(), AssignDumpId(), BuildArchiveDependencies(), datapagemap_add(), exec_command_set(), findDumpableDependencies(), identify_locking_dependencies(), lookupCreateVariable(), main(), ParseScript(), read_file_contents(), readfile(), readMessageFromPipe(), ReadToc(), repalloc(), replaceVariable(), and rewind_parseTimeLineHistory().
char* pg_strdup | ( | const char * | in | ) |
Definition at line 85 of file fe_memutils.c.
References _, EXIT_FAILURE, and fprintf.
Referenced by _allocAH(), _ArchiveEntry(), _becomeUser(), _check_database_version(), _getObjectDescription(), _selectOutputSchema(), _selectTableAccessMethod(), _selectTablespace(), _tarGetHeader(), add_one_elt(), add_stringlist_item(), adjust_data_dir(), append_depends_on_extension(), ArchiveEntry(), bool_substitute_hook(), check_locale_name(), check_required_directory(), CloneArchive(), comp_keyword_case_substitute_hook(), ConnectDatabase(), constructConnStr(), convertRegProcReference(), convertTSFunction(), create_script_for_old_cluster_deletion(), createBoundaryObjects(), CreateWalDirectoryMethod(), describeOneTableDetails(), describeRoles(), dir_open_for_write(), do_pset(), dumpAccessMethod(), dumpAttrDef(), dumpBaseType(), dumpCollation(), dumpCompositeType(), dumpConversion(), dumpDatabase(), dumpDomain(), dumpEnumType(), dumpEventTrigger(), dumpExtension(), dumpForeignDataWrapper(), dumpForeignServer(), dumpGroups(), dumpIndex(), dumpNamespace(), dumpOpclass(), dumpOpfamily(), dumpOptionsFromRestoreOptions(), dumpPolicy(), dumpProcLang(), dumpPublication(), dumpRangeType(), dumpRule(), dumpSearchPath(), dumpSequence(), dumpStatisticsExt(), dumpSubscription(), dumpTable(), dumpTableConstraintComment(), dumpTableSchema(), dumpTablespaces(), dumpTrigger(), dumpTSConfig(), dumpTSDictionary(), dumpTSParser(), dumpTSTemplate(), dumpUndefinedType(), echo_substitute_hook(), encodingid_to_string(), exec_command_g(), exec_command_gset(), exec_command_set(), fetch_count_substitute_hook(), find_matching_ts_config(), fix_path_separator(), flagInhAttrs(), flagInhIndexes(), flagInhTables(), format_numeric_locale(), get_canonical_locale_name(), get_comma_elts(), get_control_data(), get_db_infos(), get_id(), get_language_name(), get_loadable_libraries(), get_opts(), get_rel_infos(), get_restricted_token(), get_sock_dir(), get_synchronized_snapshot(), get_tablespace_paths(), get_user_info(), getAccessMethods(), getAggregates(), getBlobs(), getCollations(), getConstraints(), getConversions(), getDefaultACLs(), getDomainConstraints(), getEventTriggers(), getExtendedStatistics(), getExtensions(), getForeignDataWrappers(), getForeignServers(), getFormattedTypeName(), getFuncs(), getIndexes(), getNamespaces(), getOpclasses(), getOperators(), getOpfamilies(), getPolicies(), getProcLangs(), getPublications(), getRestoreCommand(), getRules(), gets_fromFile(), getSubscriptions(), getTableAttrs(), getTables(), getTriggers(), getTSConfigurations(), getTSDictionaries(), getTSParsers(), getTSTemplates(), getTypes(), getVariable(), handle_args(), histcontrol_substitute_hook(), histsize_substitute_hook(), identify_target_directory(), ignoreeof_substitute_hook(), initializeInput(), insert_filehash_entry(), load_resultmap(), locale_date_order(), lookupCreateVariable(), main(), MainLoop(), makeAlterConfigCommand(), open_result_files(), parallel_exec_prog(), parallel_transfer_all_new_dbs(), parse_psql_options(), parse_slash_copy(), parseAclItem(), parseCommandLine(), parseQuery(), ParseScript(), parseScriptWeight(), pg_send_history(), postprocess_sql_command(), printTableAddFooter(), printTableSetFooter(), process_backslash_command(), process_source_file(), process_target_file(), processEncodingEntry(), processExtensionTables(), processSearchPathEntry(), psql_get_variable(), pstrdup(), putVariable(), read_post_opts(), readfile(), ReconnectToServer(), regression_main(), replace_string(), RestoreArchive(), run_schedule(), run_simple_query(), RunIdentifySystem(), sanitize_line(), savePsetInfo(), sendCommand(), set_info_version(), set_tablespace_directory_suffix(), setDecimalLocale(), setup(), setup_config(), setup_connection(), setup_pgdata(), SetVariable(), SetVariableHooks(), show_context_substitute_hook(), simple_action_list_append(), simple_prompt(), split_path(), split_to_stringlist(), tar_open_for_write(), tarOpen(), try_complete_step(), and verbosity_substitute_hook().
char* pnstrdup | ( | const char * | in, |
Size | size | ||
) |
Definition at line 146 of file fe_memutils.c.
References _, EXIT_FAILURE, fprintf, malloc, palloc(), and strnlen().
Referenced by MemoryContextSwitchTo().
char* pstrdup | ( | const char * | in | ) |
Definition at line 140 of file fe_memutils.c.
References MemoryContextStrdup(), and pg_strdup().
Referenced by MemoryContextSwitchTo().
void* repalloc | ( | void * | pointer, |
Size | size | ||
) |
Definition at line 173 of file fe_memutils.c.
References AllocSizeIsValid, Assert, AssertNotInCriticalSection, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, GetMemoryChunkContext(), MemoryContextData::isReset, MemoryContextStats(), MemoryContextData::methods, MemoryContextData::name, pg_realloc(), MemoryContextMethods::realloc, unlikely, and VALGRIND_MEMPOOL_CHANGE.