PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
fe_memutils.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MaxAllocSize   ((Size) 0x3fffffff) /* 1 gigabyte - 1 */
 
#define MCXT_ALLOC_HUGE
 
#define MCXT_ALLOC_NO_OOM   0x02 /* no failure if out-of-memory */
 
#define MCXT_ALLOC_ZERO   0x04 /* zero allocated memory */
 
#define pg_malloc_object(type)   ((type *) pg_malloc(sizeof(type)))
 
#define pg_malloc0_object(type)   ((type *) pg_malloc0(sizeof(type)))
 
#define pg_malloc_array(type, count)   ((type *) pg_malloc(sizeof(type) * (count)))
 
#define pg_malloc0_array(type, count)   ((type *) pg_malloc0(sizeof(type) * (count)))
 
#define pg_realloc_array(pointer, type, count)   ((type *) pg_realloc(pointer, sizeof(type) * (count)))
 
#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)))
 

Functions

char * pg_strdup (const char *in)
 
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)
 
void pg_free (void *ptr)
 
char * pstrdup (const char *in)
 
char * pnstrdup (const char *in, Size size)
 
void * palloc (Size size)
 
void * palloc0 (Size size)
 
void * palloc_extended (Size size, int flags)
 
void * repalloc (void *pointer, Size size)
 
void pfree (void *pointer)
 
char * psprintf (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
 

Macro Definition Documentation

◆ MaxAllocSize

#define MaxAllocSize   ((Size) 0x3fffffff) /* 1 gigabyte - 1 */

Definition at line 22 of file fe_memutils.h.

◆ MCXT_ALLOC_HUGE

#define MCXT_ALLOC_HUGE
Value:
0x01 /* allow huge allocation (> 1 GB) not
* actually used for frontends */

Definition at line 28 of file fe_memutils.h.

◆ MCXT_ALLOC_NO_OOM

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

Definition at line 29 of file fe_memutils.h.

◆ MCXT_ALLOC_ZERO

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

Definition at line 30 of file fe_memutils.h.

◆ palloc0_array

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

Definition at line 77 of file fe_memutils.h.

◆ palloc0_object

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

Definition at line 75 of file fe_memutils.h.

◆ palloc_array

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

Definition at line 76 of file fe_memutils.h.

◆ palloc_object

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

Definition at line 74 of file fe_memutils.h.

◆ pg_malloc0_array

#define pg_malloc0_array (   type,
  count 
)    ((type *) pg_malloc0(sizeof(type) * (count)))

Definition at line 57 of file fe_memutils.h.

◆ pg_malloc0_object

#define pg_malloc0_object (   type)    ((type *) pg_malloc0(sizeof(type)))

Definition at line 51 of file fe_memutils.h.

◆ pg_malloc_array

#define pg_malloc_array (   type,
  count 
)    ((type *) pg_malloc(sizeof(type) * (count)))

Definition at line 56 of file fe_memutils.h.

◆ pg_malloc_object

#define pg_malloc_object (   type)    ((type *) pg_malloc(sizeof(type)))

Definition at line 50 of file fe_memutils.h.

◆ pg_realloc_array

#define pg_realloc_array (   pointer,
  type,
  count 
)    ((type *) pg_realloc(pointer, sizeof(type) * (count)))

Definition at line 63 of file fe_memutils.h.

◆ repalloc_array

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

Definition at line 78 of file fe_memutils.h.

Function Documentation

◆ palloc()

void * palloc ( Size  size)

Definition at line 1317 of file mcxt.c.

1318{
1319 /* duplicates MemoryContextAlloc to avoid increased overhead */
1320 void *ret;
1322
1325
1326 context->isReset = false;
1327
1328 /*
1329 * For efficiency reasons, we purposefully offload the handling of
1330 * allocation failures to the MemoryContextMethods implementation as this
1331 * allows these checks to be performed only when an actual malloc needs to
1332 * be done to request more memory from the OS. Additionally, not having
1333 * to execute any instructions after this call allows the compiler to use
1334 * the sibling call optimization. If you're considering adding code after
1335 * this call, consider making it the responsibility of the 'alloc'
1336 * function instead.
1337 */
1338 ret = context->methods->alloc(context, size, 0);
1339 /* We expect OOM to be handled by the alloc function */
1340 Assert(ret != NULL);
1342
1343 return ret;
1344}
#define Assert(condition)
Definition: c.h:812
#define AssertNotInCriticalSection(context)
Definition: mcxt.c:175
MemoryContext CurrentMemoryContext
Definition: mcxt.c:143
#define VALGRIND_MEMPOOL_ALLOC(context, addr, size)
Definition: memdebug.h:29
#define MemoryContextIsValid(context)
Definition: memnodes.h:145
tree context
Definition: radixtree.h:1837
static pg_noinline void Size size
Definition: slab.c:607

◆ palloc0()

void * palloc0 ( Size  size)

Definition at line 1347 of file mcxt.c.

1348{
1349 /* duplicates MemoryContextAllocZero to avoid increased overhead */
1350 void *ret;
1352
1355
1356 context->isReset = false;
1357
1358 ret = context->methods->alloc(context, size, 0);
1359
1361
1362 MemSetAligned(ret, 0, size);
1363
1364 return ret;
1365}
#define MemSetAligned(start, val, len)
Definition: c.h:1004

◆ palloc_extended()

void * palloc_extended ( Size  size,
int  flags 
)

Definition at line 1368 of file mcxt.c.

1369{
1370 /* duplicates MemoryContextAllocExtended to avoid increased overhead */
1371 void *ret;
1373
1376
1377 context->isReset = false;
1378
1379 ret = context->methods->alloc(context, size, flags);
1380 if (unlikely(ret == NULL))
1381 {
1382 return NULL;
1383 }
1384
1386
1387 if ((flags & MCXT_ALLOC_ZERO) != 0)
1388 MemSetAligned(ret, 0, size);
1389
1390 return ret;
1391}
#define unlikely(x)
Definition: c.h:330
#define MCXT_ALLOC_ZERO
Definition: fe_memutils.h:30

◆ pfree()

void pfree ( void *  pointer)

Definition at line 1521 of file mcxt.c.

1522{
1523#ifdef USE_VALGRIND
1526#endif
1527
1528 MCXT_METHOD(pointer, free_p) (pointer);
1529
1530#ifdef USE_VALGRIND
1531 if (method != MCTX_ALIGNED_REDIRECT_ID)
1533#endif
1534}
static MemoryContextMethodID GetMemoryChunkMethodID(const void *pointer)
Definition: mcxt.c:191
MemoryContext GetMemoryChunkContext(void *pointer)
Definition: mcxt.c:707
#define MCXT_METHOD(pointer, method)
Definition: mcxt.c:182
#define VALGRIND_MEMPOOL_FREE(context, addr)
Definition: memdebug.h:30
MemoryContextMethodID
@ MCTX_ALIGNED_REDIRECT_ID

◆ pg_free()

void pg_free ( void *  ptr)

Definition at line 105 of file fe_memutils.c.

106{
107 free(ptr);
108}
#define free(a)
Definition: header.h:65

References free.

Referenced by _printTocEntry(), advanceConnectionState(), append_depends_on_extension(), appendQualifiedRelation(), avlFree(), bool_substitute_hook(), calculate_totals(), check_exec(), check_for_data_types_usage(), check_for_incompatible_polymorphics(), check_publisher(), checksum_file(), close_walfile(), copy_file_blocks(), copyFile(), create_logical_replication_slot(), create_publication(), create_script_for_old_cluster_deletion(), create_subscription(), datapagemap_print(), dir_close(), dir_free(), dir_open_for_write(), do_connect(), do_watch(), drop_publication(), drop_replication_slot(), dumpFunc(), dumpRoleMembership(), dumpSequence(), enable_subscription(), EndCompressor(), FindStreamingStart(), free_command(), free_db_and_rel_infos(), free_rel_infos(), free_socket_set(), get_control_data(), get_db_rel_and_slot_infos(), get_loadable_libraries(), get_restricted_token(), get_standby_sysid(), getTimelineHistory(), icu_language_tag(), init_libpq_conn(), IssueACLPerBlob(), IssueCommandPerBlob(), libpq_get_current_wal_insert_lsn(), listSchemas(), main(), make_rfile(), makeAlterConfigCommand(), modify_subscriber_sysid(), open_walfile(), parallel_exec_prog(), parallel_transfer_all_new_dbs(), parseAclItem(), parseCommandLine(), parseQuery(), perform_rewind(), pfree(), printCrosstab(), PrintResultInCrosstab(), process_queued_fetch_requests(), rankSort(), readCommandResponse(), ReadHead(), readMessageFromPipe(), ReceiveXlogStream(), reconstruct_from_incremental_file(), reindex_one_database(), RestoreArchive(), run_schedule(), SendQuery(), set_replication_progress(), setlocales(), setup_publisher(), SetVariable(), simple_oid_list_destroy(), simple_ptr_list_destroy(), simple_string_list_destroy(), SortTocFromFile(), tar_close(), tar_free(), tar_open_for_write(), transfer_all_new_dbs(), upgrade_task_free(), upgrade_task_run(), vacuum_one_database(), verify_tar_file(), and WriteDataChunks().

◆ pg_malloc()

void * pg_malloc ( size_t  size)

Definition at line 47 of file fe_memutils.c.

48{
49 return pg_malloc_internal(size, 0);
50}
static void * pg_malloc_internal(size_t size, int flags)
Definition: fe_memutils.c:23

References pg_malloc_internal(), and size.

Referenced by _Clone(), _CustomReadFunc(), _PrintFileData(), _skipData(), add_one_elt(), add_stringlist_item(), ahprintf(), allocCStatePrepared(), ArchiveEntry(), archprintf(), astreamer_verify_content_new(), avlInsertNode(), buildACLCommands(), BuildArchiveDependencies(), check_testspec(), checksum_file(), CloneArchive(), collectBinaryUpgradeClassOids(), collectComments(), collectRoleNames(), collectSecLabels(), collectSequences(), conditional_stack_create(), conditional_stack_push(), copy_connection(), copy_file_blocks(), copyFile(), create_manifest_writer(), create_sql_command(), createBoundaryObjects(), CreateVariableSpace(), CreateWalTarMethod(), datapagemap_iterate(), decide_file_actions(), do_connect(), do_watch(), dumpFunc(), dumpTableData_insert(), escape_quotes_bki(), ExecuteSqlCommandBuf(), expr_scanner_get_substring(), find_other_exec_or_die(), findDependencyLoops(), fix_dependencies(), format_numeric_locale(), gen_db_file_maps(), get_comma_elts(), get_exec_path(), get_loadable_libraries(), get_tablespace_paths(), get_template0_info(), getAccessMethods(), getAggregates(), getCasts(), getCollations(), getConstraints(), getConversions(), getDefaultACLs(), getDomainConstraints(), getEventTriggers(), getExtendedStatistics(), getExtensions(), getForeignDataWrappers(), getForeignServers(), getFuncs(), getIndexes(), getInherits(), getLOs(), getNamespaces(), getOpclasses(), getOperators(), getOpfamilies(), getPolicies(), getProcLangs(), getPublicationNamespaces(), getPublications(), getPublicationTables(), getRules(), getSubscriptions(), getSubscriptionTables(), getTableAttrs(), getTimelineHistory(), getTransforms(), getTriggers(), getTSConfigurations(), getTSDictionaries(), getTSParsers(), getTSTemplates(), getTypes(), icu_language_tag(), identify_locking_dependencies(), libpq_fetch_file(), listSchemas(), load_backup_manifest(), load_backup_manifests(), load_resultmap(), main(), makeTableDataInfo(), NewDumpOptions(), parallel_exec_prog(), parallel_transfer_all_new_dbs(), ParallelBackupStart(), parse_manifest_file(), ParseScript(), parseScriptWeight(), parseVariable(), precheck_tar_backup_file(), pretty_wal_size(), print_aligned_text(), print_aligned_vertical(), printCrosstab(), PrintResultInCrosstab(), process_directory_recursively(), process_old_cluster_logical_slot_infos(), process_queued_fetch_requests(), process_rel_infos(), pset_quoted_string(), psqlscan_extract_substring(), psqlscan_prepare_buffer(), psqlscan_push_new_buffer(), quote_identifier(), quote_if_needed(), rankSort(), read_controlfile(), read_file_contents(), ReadDataFromArchiveNone(), readfile(), readMessageFromPipe(), ReadStr(), ReadToc(), reconstruct_from_incremental_file(), remember_to_cleanup_directory(), replace_token(), rewind_parseTimeLineHistory(), run_all_permutations(), run_permutation(), savePsetInfo(), setup_bin_paths(), SetVariable(), SetVariableHooks(), simple_oid_list_append(), simple_ptr_list_append(), simple_string_list_append(), slurpFile(), sortDumpableObjects(), SplitGUCList(), sql_exec(), sql_exec_searchtables(), StartRestoreLO(), strtokx(), tar_open_for_write(), tarPrintf(), TopoSort(), verify_backup_checksums(), verify_tar_file(), wait_for_tests(), WaitForTerminatingWorkers(), and WriteDataChunks().

◆ pg_malloc0()

void * pg_malloc0 ( size_t  size)

Definition at line 53 of file fe_memutils.c.

54{
56}

References MCXT_ALLOC_ZERO, pg_malloc_internal(), and size.

Referenced by _allocAH(), _ArchiveEntry(), _discoverArchiveFormat(), _ReadExtraToc(), add_tablespace_mapping(), alloc_socket_set(), AllocateCompressor(), allocCStatePrepared(), ArchiveEntry(), avlInit(), buildTocEntryArrays(), check_for_data_types_usage(), compile_database_list(), compile_relation_list_one_db(), connectDatabase(), CreateWalDirectoryMethod(), CreateWalTarMethod(), describeRoles(), dir_get_file_name(), dir_open_for_write(), dumpRoleMembership(), dumpSequence(), findDependencyLoops(), FindStreamingStart(), get_db_infos(), get_parallel_object_list(), GetConnection(), getFuncs(), getTables(), init_libpq_source(), init_local_source(), InitArchiveFmt_Custom(), InitArchiveFmt_Directory(), InitCompressFileHandle(), load_backup_manifest(), main(), make_incremental_rfile(), make_outputdirs(), make_rfile(), NewRestoreOptions(), parallel_exec_prog(), parallel_transfer_all_new_dbs(), ParallelBackupStart(), parse_manifest_file(), parse_slash_copy(), print_aligned_text(), printTableAddCell(), printTableAddFooter(), printTableInit(), process_backslash_command(), psql_scan_create(), ReadToc(), reconstruct_from_incremental_file(), reindex_one_database(), run_all_permutations(), scan_for_existing_tablespaces(), setup_connection(), SortTocFromFile(), StartLogStreamer(), tablespace_list_append(), tar_get_file_name(), tar_open_for_write(), TopoSort(), upgrade_task_create(), and upgrade_task_run().

◆ pg_malloc_extended()

void * pg_malloc_extended ( size_t  size,
int  flags 
)

Definition at line 59 of file fe_memutils.c.

60{
61 return pg_malloc_internal(size, flags);
62}

References pg_malloc_internal(), and size.

Referenced by do_lo_import(), and pg_log_generic_v().

◆ pg_realloc()

void * pg_realloc ( void *  ptr,
size_t  size 
)

Definition at line 65 of file fe_memutils.c.

66{
67 void *tmp;
68
69 /* Avoid unportable behavior of realloc(NULL, 0) */
70 if (ptr == NULL && size == 0)
71 size = 1;
72 tmp = realloc(ptr, size);
73 if (!tmp)
74 {
75 fprintf(stderr, _("out of memory\n"));
77 }
78 return tmp;
79}
#define fprintf(file, fmt, msg)
Definition: cubescan.l:21
#define _(x)
Definition: elog.c:90
#define realloc(a, b)
Definition: header.h:60
exit(1)
#define EXIT_FAILURE
Definition: settings.h:178

References _, exit(), EXIT_FAILURE, fprintf, realloc, and size.

Referenced by add_one_elt(), addlitchar(), BuildArchiveDependencies(), datapagemap_add(), enlargeVariables(), exec_command_set(), extend_pattern_info_array(), findDumpableDependencies(), icu_language_tag(), identify_locking_dependencies(), main(), ParseScript(), read_file_contents(), readfile(), readMessageFromPipe(), ReadToc(), repalloc(), replaceVariable(), rewind_parseTimeLineHistory(), and upgrade_task_add_step().

◆ pg_strdup()

char * pg_strdup ( const char *  in)

Definition at line 85 of file fe_memutils.c.

86{
87 char *tmp;
88
89 if (!in)
90 {
91 fprintf(stderr,
92 _("cannot duplicate null pointer (internal error)\n"));
94 }
95 tmp = strdup(in);
96 if (!tmp)
97 {
98 fprintf(stderr, _("out of memory\n"));
100 }
101 return tmp;
102}

References _, exit(), 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_publisher(), check_required_directory(), check_subscriber(), CloneArchive(), collectComments(), collectRoleNames(), collectSecLabels(), comp_keyword_case_substitute_hook(), concat_conninfo_dbname(), ConnectDatabase(), constructConnStr(), convertRegProcReference(), convertTSFunction(), create_logical_replication_slot(), 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(), dumpIndex(), dumpNamespace(), dumpOpclass(), dumpOpfamily(), dumpOptionsFromRestoreOptions(), dumpPolicy(), dumpProcLang(), dumpPublication(), dumpRangeType(), dumpRoleGUCPrivs(), dumpRule(), dumpSearchPath(), dumpSequence(), dumpStatisticsExt(), dumpSubscription(), dumpTable(), dumpTableConstraintComment(), dumpTableData(), dumpTableSchema(), dumpTablespaces(), dumpTrigger(), dumpTSConfig(), dumpTSDictionary(), dumpTSParser(), dumpTSTemplate(), dumpUndefinedType(), echo_substitute_hook(), encodingid_to_string(), exec_command_g(), exec_command_gset(), exec_command_password(), exec_command_set(), fetch_count_substitute_hook(), find_matching_ts_config(), FindDbnameInConnParams(), fix_path_separator(), flagInhAttrs(), flagInhIndexes(), flagInhTables(), format_numeric_locale(), get_base_conninfo(), get_comma_elts(), get_control_data(), get_db_infos(), get_id(), get_language_name(), get_loadable_libraries(), get_opts(), get_restricted_token(), get_sock_dir(), get_sub_conninfo(), get_synchronized_snapshot(), get_tablespace_paths(), get_template0_info(), get_user_info(), getAccessMethods(), getAggregates(), getCollations(), getConstraints(), getConversions(), getDefaultACLs(), getDomainConstraints(), getEventTriggers(), getExtendedStatistics(), getExtensions(), getForeignDataWrappers(), getForeignServers(), getFormattedTypeName(), getFuncs(), getIndexes(), getLOs(), getNamespaces(), getOpclasses(), getOperators(), getOpfamilies(), getPolicies(), getProcLangs(), getPublications(), getPublicationTables(), getRules(), gets_fromFile(), getSubscriptions(), getSubscriptionTables(), getTableAttrs(), getTables(), getTriggers(), getTSConfigurations(), getTSDictionaries(), getTSParsers(), getTSTemplates(), getTypes(), getVariable(), handle_args(), histcontrol_substitute_hook(), histsize_substitute_hook(), identify_target_directory(), ignoreeof_substitute_hook(), InitDiscoverCompressFileHandle(), initializeInput(), insert_filehash_entry(), IssueACLPerBlob(), IssueCommandPerBlob(), keepwal_add_entry(), listSchemas(), load_resultmap(), 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_old_cluster_logical_slot_infos(), process_rel_infos(), process_source_file(), process_target_file(), processEncodingEntry(), processExtensionTables(), processSearchPathEntry(), progress_update_filename(), psql_get_variable(), psqlscan_push_new_buffer(), pstrdup(), putVariable(), read_post_opts(), readfile(), ReconnectToServer(), regression_main(), RestoreArchive(), run_schedule(), run_simple_query(), RunIdentifySystem(), sanitize_line(), save_global_locale(), savePsetInfo(), search_directory(), sendCommand(), set_info_version(), set_locale_and_encoding(), setDecimalLocale(), setup(), setup_config(), setup_connection(), setup_pgdata(), setup_publisher(), SetVariable(), SetVariableHooks(), show_context_substitute_hook(), simple_action_list_append(), simple_prompt_extended(), split_path(), split_to_stringlist(), tar_open_for_write(), tarOpen(), and verbosity_substitute_hook().

◆ pnstrdup()

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

Definition at line 1707 of file mcxt.c.

1708{
1709 char *out;
1710
1711 len = strnlen(in, len);
1712
1713 out = palloc(len + 1);
1714 memcpy(out, in, len);
1715 out[len] = '\0';
1716
1717 return out;
1718}
void * palloc(Size size)
Definition: mcxt.c:1317
const void size_t len
size_t strnlen(const char *str, size_t maxlen)
Definition: strnlen.c:26

◆ psprintf()

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

◆ pstrdup()

char * pstrdup ( const char *  in)

Definition at line 1696 of file mcxt.c.

1697{
1699}
char * MemoryContextStrdup(MemoryContext context, const char *string)
Definition: mcxt.c:1683

◆ pvsnprintf()

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

◆ repalloc()

void * repalloc ( void *  pointer,
Size  size 
)

Definition at line 1541 of file mcxt.c.

1542{
1543#ifdef USE_VALGRIND
1545#endif
1546#if defined(USE_ASSERT_CHECKING) || defined(USE_VALGRIND)
1548#endif
1549 void *ret;
1550
1552
1553 /* isReset must be false already */
1554 Assert(!context->isReset);
1555
1556 /*
1557 * For efficiency reasons, we purposefully offload the handling of
1558 * allocation failures to the MemoryContextMethods implementation as this
1559 * allows these checks to be performed only when an actual malloc needs to
1560 * be done to request more memory from the OS. Additionally, not having
1561 * to execute any instructions after this call allows the compiler to use
1562 * the sibling call optimization. If you're considering adding code after
1563 * this call, consider making it the responsibility of the 'realloc'
1564 * function instead.
1565 */
1566 ret = MCXT_METHOD(pointer, realloc) (pointer, size, 0);
1567
1568#ifdef USE_VALGRIND
1569 if (method != MCTX_ALIGNED_REDIRECT_ID)
1570 VALGRIND_MEMPOOL_CHANGE(context, pointer, ret, size);
1571#endif
1572
1573 return ret;
1574}
#define VALGRIND_MEMPOOL_CHANGE(context, optr, nptr, size)
Definition: memdebug.h:31