Ruby
2.4.2p198(2017-09-14revision59899)
|
#include <sys/types.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/param.h>
Go to the source code of this file.
Data Structures | |
struct | mallinfo |
struct | malloc_chunk |
struct | malloc_tree_chunk |
struct | malloc_segment |
struct | malloc_state |
struct | malloc_params |
Macros | |
#define | MAX_SIZE_T (~(size_t)0) |
#define | ONLY_MSPACES 0 |
#define | MSPACES 0 |
#define | MALLOC_ALIGNMENT ((size_t)8U) |
#define | FOOTERS 0 |
#define | ABORT abort() |
#define | ABORT_ON_ASSERT_FAILURE 1 |
#define | PROCEED_ON_ERROR 0 |
#define | USE_LOCKS 0 |
#define | INSECURE 0 |
#define | HAVE_MMAP 1 |
#define | MMAP_CLEARS 1 |
#define | HAVE_MREMAP 0 |
#define | MALLOC_FAILURE_ACTION errno = ENOMEM; |
#define | HAVE_MORECORE 1 |
#define | MORECORE sbrk |
#define | MORECORE_CONTIGUOUS 1 |
#define | DEFAULT_GRANULARITY (0) /* 0 means to compute in init_mparams */ |
#define | DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U) |
#define | DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U) |
#define | USE_BUILTIN_FFS 0 |
#define | USE_DEV_RANDOM 0 |
#define | NO_MALLINFO 0 |
#define | MALLINFO_FIELD_TYPE size_t |
#define | M_TRIM_THRESHOLD (-1) |
#define | M_GRANULARITY (-2) |
#define | M_MMAP_THRESHOLD (-3) |
#define | _STRUCT_MALLINFO |
#define | dlcalloc calloc |
#define | dlfree free |
#define | dlmalloc malloc |
#define | dlmemalign memalign |
#define | dlrealloc realloc |
#define | dlvalloc valloc |
#define | dlpvalloc pvalloc |
#define | dlmallinfo mallinfo |
#define | dlmallopt mallopt |
#define | dlmalloc_trim malloc_trim |
#define | dlmalloc_stats malloc_stats |
#define | dlmalloc_usable_size malloc_usable_size |
#define | dlmalloc_footprint malloc_footprint |
#define | dlmalloc_max_footprint malloc_max_footprint |
#define | dlindependent_calloc independent_calloc |
#define | dlindependent_comalloc independent_comalloc |
#define | assert(x) |
#define | malloc_getpagesize ((size_t)4096U) |
#define | SIZE_T_SIZE (sizeof(size_t)) |
#define | SIZE_T_BITSIZE (sizeof(size_t) << 3) |
#define | SIZE_T_ZERO ((size_t)0) |
#define | SIZE_T_ONE ((size_t)1) |
#define | SIZE_T_TWO ((size_t)2) |
#define | TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1) |
#define | FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2) |
#define | SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES) |
#define | HALF_MAX_SIZE_T (MAX_SIZE_T / 2U) |
#define | CHUNK_ALIGN_MASK (MALLOC_ALIGNMENT - SIZE_T_ONE) |
#define | is_aligned(A) (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0) |
#define | align_offset(A) |
#define | MFAIL ((void*)(MAX_SIZE_T)) |
#define | CMFAIL ((char*)(MFAIL)) /* defined for convenience */ |
#define | IS_MMAPPED_BIT (SIZE_T_ONE) |
#define | USE_MMAP_BIT (SIZE_T_ONE) |
#define | CALL_MUNMAP(a, s) munmap((a), (s)) |
#define | MMAP_PROT (PROT_READ|PROT_WRITE) |
#define | MMAP_FLAGS (MAP_PRIVATE) |
#define | CALL_MMAP(s) |
#define | DIRECT_MMAP(s) CALL_MMAP(s) |
#define | CALL_MREMAP(addr, osz, nsz, mv) MFAIL |
#define | CALL_MORECORE(S) MORECORE(S) |
#define | USE_NONCONTIGUOUS_BIT (4U) |
#define | EXTERN_BIT (8U) |
#define | USE_LOCK_BIT (0U) |
#define | INITIAL_LOCK(l) |
#define | ACQUIRE_MORECORE_LOCK() |
#define | RELEASE_MORECORE_LOCK() |
#define | ACQUIRE_MAGIC_INIT_LOCK() |
#define | RELEASE_MAGIC_INIT_LOCK() |
#define | MCHUNK_SIZE (sizeof(mchunk)) |
#define | CHUNK_OVERHEAD (SIZE_T_SIZE) |
#define | MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) |
#define | MMAP_FOOT_PAD (FOUR_SIZE_T_SIZES) |
#define | MIN_CHUNK_SIZE ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) |
#define | chunk2mem(p) ((void*)((char*)(p) + TWO_SIZE_T_SIZES)) |
#define | mem2chunk(mem) ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES)) |
#define | align_as_chunk(A) (mchunkptr)((A) + align_offset(chunk2mem(A))) |
#define | MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2) |
#define | MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE) |
#define | pad_request(req) (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) |
#define | request2size(req) (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req)) |
#define | PINUSE_BIT (SIZE_T_ONE) |
#define | CINUSE_BIT (SIZE_T_TWO) |
#define | INUSE_BITS (PINUSE_BIT|CINUSE_BIT) |
#define | FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE) |
#define | cinuse(p) ((p)->head & CINUSE_BIT) |
#define | pinuse(p) ((p)->head & PINUSE_BIT) |
#define | chunksize(p) ((p)->head & ~(INUSE_BITS)) |
#define | clear_pinuse(p) ((p)->head &= ~PINUSE_BIT) |
#define | clear_cinuse(p) ((p)->head &= ~CINUSE_BIT) |
#define | chunk_plus_offset(p, s) ((mchunkptr)(((char*)(p)) + (s))) |
#define | chunk_minus_offset(p, s) ((mchunkptr)(((char*)(p)) - (s))) |
#define | next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->head & ~INUSE_BITS))) |
#define | prev_chunk(p) ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) )) |
#define | next_pinuse(p) ((next_chunk(p)->head) & PINUSE_BIT) |
#define | get_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot) |
#define | set_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s)) |
#define | set_size_and_pinuse_of_free_chunk(p, s) ((p)->head = (s|PINUSE_BIT), set_foot(p, s)) |
#define | set_free_with_pinuse(p, s, n) (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s)) |
#define | is_mmapped(p) (!((p)->head & PINUSE_BIT) && ((p)->prev_foot & IS_MMAPPED_BIT)) |
#define | overhead_for(p) (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD) |
#define | calloc_must_clear(p) (!is_mmapped(p)) |
#define | leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1]) |
#define | get_segment_flags(S) ((S)->sflags) |
#define | set_segment_flags(S, v) ((S)->sflags = (v)) |
#define | check_segment_merge(S, b, s) (1) |
#define | is_mmapped_segment(S) (get_segment_flags(S) & IS_MMAPPED_BIT) |
#define | is_extern_segment(S) (get_segment_flags(S) & EXTERN_BIT) |
#define | NSMALLBINS (32U) |
#define | NTREEBINS (32U) |
#define | SMALLBIN_SHIFT (3U) |
#define | SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT) |
#define | TREEBIN_SHIFT (8U) |
#define | MIN_LARGE_SIZE (SIZE_T_ONE << TREEBIN_SHIFT) |
#define | MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE) |
#define | MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD) |
#define | gm (&_gm_) |
#define | is_global(M) ((M) == &_gm_) |
#define | is_initialized(M) ((M)->top != 0) |
#define | use_lock(M) ((M)->mflags & USE_LOCK_BIT) |
#define | enable_lock(M) ((M)->mflags |= USE_LOCK_BIT) |
#define | disable_lock(M) ((M)->mflags &= ~USE_LOCK_BIT) |
#define | use_mmap(M) ((M)->mflags & USE_MMAP_BIT) |
#define | enable_mmap(M) ((M)->mflags |= USE_MMAP_BIT) |
#define | disable_mmap(M) ((M)->mflags &= ~USE_MMAP_BIT) |
#define | use_noncontiguous(M) ((M)->mflags & USE_NONCONTIGUOUS_BIT) |
#define | disable_contiguous(M) ((M)->mflags |= USE_NONCONTIGUOUS_BIT) |
#define | set_lock(M, L) |
#define | page_align(S) (((S) + (mparams.page_size)) & ~(mparams.page_size - SIZE_T_ONE)) |
#define | granularity_align(S) (((S) + (mparams.granularity)) & ~(mparams.granularity - SIZE_T_ONE)) |
#define | is_page_aligned(S) (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0) |
#define | is_granularity_aligned(S) (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0) |
#define | segment_holds(S, A) ((char*)(A) >= S->base && (char*)(A) < S->base + S->size) |
#define | should_trim(M, s) ((s) > (M)->trim_check) |
#define | TOP_FOOT_SIZE (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE) |
#define | PREACTION(M) (0) |
#define | POSTACTION(M) |
#define | CORRUPTION_ERROR_ACTION(m) ABORT |
#define | USAGE_ERROR_ACTION(m, p) ABORT |
#define | check_free_chunk(M, P) |
#define | check_inuse_chunk(M, P) |
#define | check_malloced_chunk(M, P, N) |
#define | check_mmapped_chunk(M, P) |
#define | check_malloc_state(M) |
#define | check_top_chunk(M, P) |
#define | is_small(s) (((s) >> SMALLBIN_SHIFT) < NSMALLBINS) |
#define | small_index(s) ((s) >> SMALLBIN_SHIFT) |
#define | small_index2size(i) ((i) << SMALLBIN_SHIFT) |
#define | MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE)) |
#define | smallbin_at(M, i) ((sbinptr)((char*)&((M)->smallbins[(i)<<1]))) |
#define | treebin_at(M, i) (&((M)->treebins[i])) |
#define | compute_tree_index(S, I) |
#define | bit_for_tree_index(i) (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2) |
#define | leftshift_for_tree_index(i) |
#define | minsize_for_tree_index(i) |
#define | idx2bit(i) ((binmap_t)(1) << (i)) |
#define | mark_smallmap(M, i) ((M)->smallmap |= idx2bit(i)) |
#define | clear_smallmap(M, i) ((M)->smallmap &= ~idx2bit(i)) |
#define | smallmap_is_marked(M, i) ((M)->smallmap & idx2bit(i)) |
#define | mark_treemap(M, i) ((M)->treemap |= idx2bit(i)) |
#define | clear_treemap(M, i) ((M)->treemap &= ~idx2bit(i)) |
#define | treemap_is_marked(M, i) ((M)->treemap & idx2bit(i)) |
#define | compute_bit2idx(X, I) |
#define | least_bit(x) ((x) & -(x)) |
#define | left_bits(x) ((x<<1) | -(x<<1)) |
#define | same_or_left_bits(x) ((x) | -(x)) |
#define | ok_address(M, a) ((char*)(a) >= (M)->least_addr) |
#define | ok_next(p, n) ((char*)(p) < (char*)(n)) |
#define | ok_cinuse(p) cinuse(p) |
#define | ok_pinuse(p) pinuse(p) |
#define | ok_magic(M) (1) |
#define | RTCHECK(e) (e) |
#define | mark_inuse_foot(M, p, s) |
#define | set_inuse(M, p, s) |
#define | set_inuse_and_pinuse(M, p, s) |
#define | set_size_and_pinuse_of_inuse_chunk(M, p, s) ((p)->head = (s|PINUSE_BIT|CINUSE_BIT)) |
#define | insert_small_chunk(M, P, S) |
#define | unlink_small_chunk(M, P, S) |
#define | unlink_first_small_chunk(M, B, P, I) |
#define | replace_dv(M, P, S) |
#define | insert_large_chunk(M, X, S) |
#define | unlink_large_chunk(M, X) |
#define | insert_chunk(M, P, S) |
#define | unlink_chunk(M, P, S) |
#define | internal_malloc(m, b) dlmalloc(b) |
#define | internal_free(m, mem) dlfree(mem) |
#define | fm gm |
Typedefs | |
typedef struct malloc_chunk | mchunk |
typedef struct malloc_chunk * | mchunkptr |
typedef struct malloc_chunk * | sbinptr |
typedef size_t | bindex_t |
typedef unsigned int | binmap_t |
typedef unsigned int | flag_t |
typedef struct malloc_tree_chunk | tchunk |
typedef struct malloc_tree_chunk * | tchunkptr |
typedef struct malloc_tree_chunk * | tbinptr |
typedef struct malloc_segment | msegment |
typedef struct malloc_segment * | msegmentptr |
typedef struct malloc_state * | mstate |
Functions | |
void * | dlmalloc (size_t) |
void | dlfree (void *) |
void * | dlcalloc (size_t, size_t) |
void * | dlrealloc (void *, size_t) |
void * | dlmemalign (size_t, size_t) |
void * | dlvalloc (size_t) |
int | dlmallopt (int, int) |
size_t | dlmalloc_footprint (void) |
size_t | dlmalloc_max_footprint (void) |
struct mallinfo | dlmallinfo (void) |
void ** | dlindependent_calloc (size_t, size_t, void **) |
void ** | dlindependent_comalloc (size_t, size_t *, void **) |
void * | dlpvalloc (size_t) |
int | dlmalloc_trim (size_t) |
size_t | dlmalloc_usable_size (void *) |
void | dlmalloc_stats (void) |
static msegmentptr | segment_holding (mstate m, char *addr) |
static int | has_segment_link (mstate m, msegmentptr ss) |
static int | init_mparams (void) |
static int | change_mparam (int param_number, int value) |
static struct mallinfo | internal_mallinfo (mstate m) |
static void | internal_malloc_stats (mstate m) |
static void * | mmap_alloc (mstate m, size_t nb) |
static mchunkptr | mmap_resize (mstate m, mchunkptr oldp, size_t nb) |
static void | init_top (mstate m, mchunkptr p, size_t psize) |
static void | init_bins (mstate m) |
static void * | prepend_alloc (mstate m, char *newbase, char *oldbase, size_t nb) |
static void | add_segment (mstate m, char *tbase, size_t tsize, flag_t mmapped) |
static void * | sys_alloc (mstate m, size_t nb) |
static size_t | release_unused_segments (mstate m) |
static int | sys_trim (mstate m, size_t pad) |
static void * | tmalloc_large (mstate m, size_t nb) |
static void * | tmalloc_small (mstate m, size_t nb) |
static void * | internal_realloc (mstate m, void *oldmem, size_t bytes) |
static void * | internal_memalign (mstate m, size_t alignment, size_t bytes) |
static void ** | ialloc (mstate m, size_t n_elements, size_t *sizes, int opts, void *chunks[]) |
void ** | dlindependent_calloc (size_t n_elements, size_t elem_size, void *chunks[]) |
void ** | dlindependent_comalloc (size_t n_elements, size_t sizes[], void *chunks[]) |
Variables | |
static int | dev_zero_fd = -1 |
static struct malloc_params | mparams |
static struct malloc_state | _gm_ |
#define _STRUCT_MALLINFO |
Definition at line 626 of file dlmalloc.c.
#define ABORT abort() |
Definition at line 502 of file dlmalloc.c.
Referenced by init_mparams().
#define ABORT_ON_ASSERT_FAILURE 1 |
Definition at line 505 of file dlmalloc.c.
#define ACQUIRE_MAGIC_INIT_LOCK | ( | ) |
Definition at line 1512 of file dlmalloc.c.
Referenced by init_mparams().
#define ACQUIRE_MORECORE_LOCK | ( | ) |
Definition at line 1504 of file dlmalloc.c.
Referenced by sys_alloc(), and sys_trim().
Definition at line 1691 of file dlmalloc.c.
Referenced by change_mparam(), dlmallopt(), internal_mallinfo(), internal_malloc_stats(), prepend_alloc(), and release_unused_segments().
#define align_offset | ( | A | ) |
Definition at line 1274 of file dlmalloc.c.
Referenced by add_segment(), init_top(), and mmap_alloc().
#define assert | ( | x | ) |
Definition at line 1176 of file dlmalloc.c.
Referenced by add_segment(), aligned_malloc(), ary_ensure_room_for_unshift(), ary_make_partial(), ary_make_shared(), ary_memcpy0(), ary_resize_capa(), ary_shrink_capa(), bary2bdigitdbl(), bary_addc(), bary_divmod(), bary_divmod_normal(), bary_mul_balance_with_mulfunc(), bary_mul_karatsuba(), bary_mul_normal(), bary_mul_precheck(), bary_mul_single(), bary_mul_toom3(), bary_muladd_1xN(), bary_mulsub_1xN(), bary_short_mul(), bary_small_lshift(), bary_small_rshift(), bary_sq_fast(), bary_subb(), bary_unpack(), bary_unpack_internal(), bdigitdbl2bary(), big2str_2bdigits(), big2str_generic(), big2str_karatsuba(), big_shift2(), bigdivrem_mulsub(), bigdivrem_restoring(), bigdivrem_single1(), bigsub_int(), c_gregorian_last_day_of_month(), c_gregorian_to_yday(), c_julian_last_day_of_month(), c_julian_to_yday(), canonicalize_c_jd(), canonicalize_s_jd(), change_mparam(), check_generation_i(), check_rounding_mode_option(), compile_array_keyword_arg(), d_complex_new_internal(), d_simple_new_internal(), dlmalloc(), dlmallopt(), f_complex_new2(), f_complex_new_bang1(), f_complex_new_bang2(), f_complex_polar(), f_gcd(), f_imul(), f_muldiv(), f_rational_new2(), f_rational_new_no_reduce2(), fstr_update_callback(), gc_aging(), gc_enter(), gc_exit(), gc_marks_continue(), gc_marks_finish(), gc_marks_step(), gc_marks_wb_unprotected_objects(), gc_mode_transition(), gc_start(), gc_sweep_continue(), get_c_civil(), get_c_df(), get_c_jd(), get_c_time(), get_s_civil(), get_s_jd(), guess_style(), hash_id_table_foreach(), hash_sum(), hash_table_raw_insert(), heap_get_freeobj_from_next_freepage(), heap_pages_free_unused_pages(), heap_prepare(), ialloc(), ibf_dump_code(), ibf_dump_id_list_i(), ibf_load_code(), Init_Complex(), Init_date_core(), Init_Rational(), Init_String(), integer_unpack_num_bdigits(), internal_memalign(), iseq_set_arguments(), iseq_set_sequence(), list_id_table_foreach(), list_id_table_foreach_values(), list_ids_bsearch(), list_table_extend(), list_table_index(), local_df(), local_jd(), make_tab_empty(), maxpow_in_bdigit_dbl(), mix_id_table_insert(), mmap_alloc(), newobj_init(), nkf_buf_at(), nkf_buf_pop(), nurat_canonicalize(), objspace_malloc_increase(), ossl_asn1prim_to_der(), ossl_bin2hex(), ossl_cipher_final(), ossl_cipher_update(), ossl_hmac_digest(), pop_mark_stack_chunk(), prepend_alloc(), push_mark_stack_chunk(), queue_closed_result(), queue_do_pop(), rb_absint_numwords(), rb_ary_shift(), rb_ary_sort_bang(), rb_big_divrem_normal(), rb_big_mul_toom3(), rb_fix_digits(), rb_int_digits_bigbase(), rb_objspace_call_finalizer(), rb_rational_uminus(), rb_str_change_terminator_length(), rb_str_tmp_frozen_release(), rb_str_update(), rb_wb_protected_newobj_of(), rb_wb_unprotected_newobj_of(), register_fstring(), release_unused_segments(), rgengc_check_relation(), rgengc_rememberset_mark(), rgengc_remembersetbits_set(), RVALUE_AGE_RESET(), RVALUE_AGE_SET_CANDIDATE(), RVALUE_AGE_SET_OLD(), RVALUE_DEMOTE(), set_of(), SHA256_End(), SHA256_Final(), SHA256_Update(), SHA384_End(), SHA384_Final(), SHA512_End(), SHA512_Final(), SHA512_Update(), str2big_karatsuba(), str2big_normal(), str2big_poweroftwo(), str_buf_cat(), str_new_frozen(), str_replace(), sum_iter(), tmalloc_large(), tmalloc_small(), verify_internal_consistency_i(), VpCopy(), VpSetPTR(), yaml_alias_event_initialize(), yaml_document_add_mapping(), yaml_document_add_scalar(), yaml_document_add_sequence(), yaml_document_append_mapping_pair(), yaml_document_append_sequence_item(), yaml_document_delete(), yaml_document_end_event_initialize(), yaml_document_get_node(), yaml_document_get_root_node(), yaml_document_initialize(), yaml_document_start_event_initialize(), yaml_emitter_close(), yaml_emitter_delete(), yaml_emitter_dump(), yaml_emitter_dump_node(), yaml_emitter_flush(), yaml_emitter_initialize(), yaml_emitter_open(), yaml_emitter_process_scalar(), yaml_emitter_set_break(), yaml_emitter_set_canonical(), yaml_emitter_set_encoding(), yaml_emitter_set_indent(), yaml_emitter_set_output(), yaml_emitter_set_output_file(), yaml_emitter_set_output_string(), yaml_emitter_set_unicode(), yaml_emitter_set_width(), yaml_emitter_state_machine(), yaml_event_delete(), yaml_mapping_end_event_initialize(), yaml_mapping_start_event_initialize(), yaml_parser_delete(), yaml_parser_initialize(), yaml_parser_load(), yaml_parser_load_document(), yaml_parser_load_node(), yaml_parser_parse(), yaml_parser_scan(), yaml_parser_set_encoding(), yaml_parser_set_input(), yaml_parser_set_input_file(), yaml_parser_set_input_string(), yaml_parser_state_machine(), yaml_parser_update_buffer(), yaml_scalar_event_initialize(), yaml_sequence_end_event_initialize(), yaml_sequence_start_event_initialize(), yaml_stream_end_event_initialize(), yaml_stream_start_event_initialize(), and yaml_token_delete().
#define bit_for_tree_index | ( | i | ) | (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2) |
Definition at line 2329 of file dlmalloc.c.
#define CALL_MMAP | ( | s | ) |
Definition at line 1318 of file dlmalloc.c.
Referenced by dlmallopt(), and sys_alloc().
Definition at line 1407 of file dlmalloc.c.
Referenced by sys_alloc(), and sys_trim().
#define CALL_MREMAP | ( | addr, | |
osz, | |||
nsz, | |||
mv | |||
) | MFAIL |
Definition at line 1403 of file dlmalloc.c.
Referenced by mmap_resize(), and sys_trim().
#define CALL_MUNMAP | ( | a, | |
s | |||
) | munmap((a), (s)) |
Definition at line 1303 of file dlmalloc.c.
Referenced by dlfree(), dlmallopt(), release_unused_segments(), and sys_trim().
#define calloc_must_clear | ( | p | ) | (!is_mmapped(p)) |
Definition at line 1763 of file dlmalloc.c.
Referenced by dlcalloc(), and dlmallopt().
Definition at line 2253 of file dlmalloc.c.
Referenced by dlfree(), dlmallopt(), and prepend_alloc().
Definition at line 2254 of file dlmalloc.c.
Referenced by dlfree(), dlmallopt(), ialloc(), internal_memalign(), and internal_realloc().
#define check_malloc_state | ( | M | ) |
Definition at line 2257 of file dlmalloc.c.
Referenced by internal_mallinfo(), and internal_malloc_stats().
Definition at line 2255 of file dlmalloc.c.
Referenced by dlmalloc(), dlmallopt(), prepend_alloc(), and sys_alloc().
Definition at line 2256 of file dlmalloc.c.
Referenced by mmap_alloc(), and mmap_resize().
#define check_segment_merge | ( | S, | |
b, | |||
s | |||
) | (1) |
Definition at line 1972 of file dlmalloc.c.
Referenced by sys_alloc().
Definition at line 2258 of file dlmalloc.c.
Referenced by add_segment(), dlmalloc(), dlmallopt(), prepend_alloc(), sys_alloc(), and sys_trim().
#define chunk2mem | ( | p | ) | ((void*)((char*)(p) + TWO_SIZE_T_SIZES)) |
Definition at line 1688 of file dlmalloc.c.
Referenced by add_segment(), change_mparam(), dlmalloc(), dlmallopt(), ialloc(), init_top(), internal_memalign(), internal_realloc(), mmap_alloc(), prepend_alloc(), sys_alloc(), tmalloc_large(), and tmalloc_small().
#define CHUNK_ALIGN_MASK (MALLOC_ALIGNMENT - SIZE_T_ONE) |
Definition at line 1268 of file dlmalloc.c.
Referenced by add_segment(), change_mparam(), mmap_alloc(), and mmap_resize().
#define chunk_minus_offset | ( | p, | |
s | |||
) | ((mchunkptr)(((char*)(p)) - (s))) |
Definition at line 1733 of file dlmalloc.c.
Referenced by dlfree(), and dlmallopt().
#define CHUNK_OVERHEAD (SIZE_T_SIZE) |
Definition at line 1675 of file dlmalloc.c.
Referenced by ialloc(), and internal_memalign().
#define chunk_plus_offset | ( | p, | |
s | |||
) | ((mchunkptr)(((char*)(p)) + (s))) |
Definition at line 1732 of file dlmalloc.c.
Referenced by add_segment(), change_mparam(), dlfree(), dlmalloc(), dlmallopt(), ialloc(), init_top(), internal_memalign(), internal_realloc(), mmap_alloc(), mmap_resize(), prepend_alloc(), sys_alloc(), tmalloc_large(), and tmalloc_small().
#define chunksize | ( | p | ) | ((p)->head & ~(INUSE_BITS)) |
Definition at line 1726 of file dlmalloc.c.
Referenced by change_mparam(), dlfree(), dlmalloc(), dlmalloc_usable_size(), dlmallopt(), ialloc(), internal_mallinfo(), internal_malloc_stats(), internal_memalign(), internal_realloc(), mmap_resize(), prepend_alloc(), release_unused_segments(), tmalloc_large(), and tmalloc_small().
#define cinuse | ( | p | ) | ((p)->head & CINUSE_BIT) |
Definition at line 1724 of file dlmalloc.c.
Referenced by change_mparam(), dlfree(), dlmalloc_usable_size(), dlmallopt(), internal_mallinfo(), internal_malloc_stats(), prepend_alloc(), and release_unused_segments().
#define CINUSE_BIT (SIZE_T_TWO) |
Definition at line 1717 of file dlmalloc.c.
Referenced by change_mparam(), dlmallopt(), internal_memalign(), mmap_alloc(), and mmap_resize().
#define clear_cinuse | ( | p | ) | ((p)->head &= ~CINUSE_BIT) |
Definition at line 1729 of file dlmalloc.c.
#define clear_pinuse | ( | p | ) | ((p)->head &= ~PINUSE_BIT) |
Definition at line 1728 of file dlmalloc.c.
Definition at line 2350 of file dlmalloc.c.
Definition at line 2354 of file dlmalloc.c.
#define CMFAIL ((char*)(MFAIL)) /* defined for convenience */ |
Definition at line 1289 of file dlmalloc.c.
Referenced by dlmallopt(), mmap_alloc(), mmap_resize(), sys_alloc(), and sys_trim().
#define compute_bit2idx | ( | X, | |
I | |||
) |
Definition at line 2372 of file dlmalloc.c.
Referenced by dlmalloc(), dlmallopt(), tmalloc_large(), and tmalloc_small().
Definition at line 2309 of file dlmalloc.c.
Referenced by change_mparam(), and tmalloc_large().
#define CORRUPTION_ERROR_ACTION | ( | m | ) | ABORT |
Definition at line 2240 of file dlmalloc.c.
Referenced by tmalloc_large(), and tmalloc_small().
#define DEFAULT_GRANULARITY (0) /* 0 means to compute in init_mparams */ |
Definition at line 551 of file dlmalloc.c.
Referenced by init_mparams().
#define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U) |
Definition at line 565 of file dlmalloc.c.
Referenced by init_mparams().
#define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U) |
Definition at line 558 of file dlmalloc.c.
Referenced by init_mparams().
#define DIRECT_MMAP | ( | s | ) | CALL_MMAP(s) |
Definition at line 1324 of file dlmalloc.c.
Referenced by mmap_alloc().
#define disable_contiguous | ( | M | ) | ((M)->mflags |= USE_NONCONTIGUOUS_BIT) |
Definition at line 2130 of file dlmalloc.c.
Referenced by dlmallopt(), and sys_alloc().
#define disable_lock | ( | M | ) | ((M)->mflags &= ~USE_LOCK_BIT) |
Definition at line 2123 of file dlmalloc.c.
#define disable_mmap | ( | M | ) | ((M)->mflags &= ~USE_MMAP_BIT) |
Definition at line 2127 of file dlmalloc.c.
Referenced by ialloc().
#define dlcalloc calloc |
Definition at line 653 of file dlmalloc.c.
#define dlfree free |
Definition at line 654 of file dlmalloc.c.
Referenced by dlrealloc().
#define dlindependent_calloc independent_calloc |
Definition at line 667 of file dlmalloc.c.
#define dlindependent_comalloc independent_comalloc |
Definition at line 668 of file dlmalloc.c.
#define dlmallinfo mallinfo |
Definition at line 660 of file dlmalloc.c.
#define dlmalloc malloc |
Definition at line 655 of file dlmalloc.c.
Referenced by dlcalloc(), and dlrealloc().
#define dlmalloc_footprint malloc_footprint |
Definition at line 665 of file dlmalloc.c.
#define dlmalloc_max_footprint malloc_max_footprint |
Definition at line 666 of file dlmalloc.c.
void dlmalloc_stats malloc_stats |
Definition at line 663 of file dlmalloc.c.
#define dlmalloc_trim malloc_trim |
Definition at line 662 of file dlmalloc.c.
#define dlmalloc_usable_size malloc_usable_size |
Definition at line 664 of file dlmalloc.c.
#define dlmallopt mallopt |
Definition at line 661 of file dlmalloc.c.
#define dlmemalign memalign |
Definition at line 656 of file dlmalloc.c.
Referenced by dlpvalloc(), and dlvalloc().
#define dlpvalloc pvalloc |
Definition at line 659 of file dlmalloc.c.
#define dlrealloc realloc |
Definition at line 657 of file dlmalloc.c.
#define dlvalloc valloc |
Definition at line 658 of file dlmalloc.c.
#define enable_lock | ( | M | ) | ((M)->mflags |= USE_LOCK_BIT) |
Definition at line 2122 of file dlmalloc.c.
#define enable_mmap | ( | M | ) | ((M)->mflags |= USE_MMAP_BIT) |
Definition at line 2126 of file dlmalloc.c.
Referenced by ialloc().
#define EXTERN_BIT (8U) |
Definition at line 1416 of file dlmalloc.c.
Referenced by dlmallopt().
#define FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE) |
Definition at line 1721 of file dlmalloc.c.
Referenced by add_segment(), change_mparam(), internal_mallinfo(), internal_malloc_stats(), mmap_alloc(), and mmap_resize().
#define fm gm |
Referenced by dlfree(), and dlmallopt().
#define FOOTERS 0 |
Definition at line 499 of file dlmalloc.c.
#define FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2) |
Definition at line 1263 of file dlmalloc.c.
Referenced by add_segment().
#define get_foot | ( | p, | |
s | |||
) | (((mchunkptr)((char*)(p) + (s)))->prev_foot) |
Definition at line 1743 of file dlmalloc.c.
Definition at line 1970 of file dlmalloc.c.
Referenced by dlmallopt(), and sys_alloc().
#define gm (&_gm_) |
Definition at line 2113 of file dlmalloc.c.
Referenced by dlindependent_calloc(), dlindependent_comalloc(), dlmallinfo(), dlmalloc(), dlmalloc_footprint(), dlmalloc_max_footprint(), dlmalloc_stats(), dlmalloc_trim(), dlmemalign(), dlrealloc(), and init_mparams().
#define granularity_align | ( | S | ) | (((S) + (mparams.granularity)) & ~(mparams.granularity - SIZE_T_ONE)) |
Definition at line 2142 of file dlmalloc.c.
Referenced by dlmallopt(), mmap_alloc(), mmap_resize(), and sys_alloc().
#define HALF_MAX_SIZE_T (MAX_SIZE_T / 2U) |
Definition at line 1265 of file dlmalloc.c.
Referenced by sys_alloc(), and sys_trim().
#define HAVE_MMAP 1 |
Definition at line 517 of file dlmalloc.c.
Referenced by sys_alloc(), and sys_trim().
#define HAVE_MORECORE 1 |
Definition at line 536 of file dlmalloc.c.
Referenced by sys_alloc(), and sys_trim().
#define HAVE_MREMAP 0 |
Definition at line 526 of file dlmalloc.c.
#define idx2bit | ( | i | ) | ((binmap_t)(1) << (i)) |
Definition at line 2346 of file dlmalloc.c.
Referenced by dlmalloc(), dlmallopt(), and tmalloc_large().
#define INITIAL_LOCK | ( | l | ) |
Definition at line 1497 of file dlmalloc.c.
Referenced by dlmallopt(), and init_mparams().
#define INSECURE 0 |
Definition at line 514 of file dlmalloc.c.
Definition at line 3176 of file dlmalloc.c.
Referenced by add_segment(), dlfree(), dlmallopt(), prepend_alloc(), and tmalloc_large().
Definition at line 3035 of file dlmalloc.c.
Referenced by release_unused_segments().
Definition at line 2964 of file dlmalloc.c.
#define internal_free | ( | m, | |
mem | |||
) | dlfree(mem) |
Definition at line 3198 of file dlmalloc.c.
Referenced by internal_memalign(), and internal_realloc().
#define internal_malloc | ( | m, | |
b | |||
) | dlmalloc(b) |
Definition at line 3197 of file dlmalloc.c.
Referenced by dlmallopt(), ialloc(), internal_memalign(), and internal_realloc().
#define INUSE_BITS (PINUSE_BIT|CINUSE_BIT) |
Definition at line 1718 of file dlmalloc.c.
Referenced by dlfree(), and dlmallopt().
#define is_aligned | ( | A | ) | (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0) |
Definition at line 1271 of file dlmalloc.c.
Referenced by add_segment(), change_mparam(), and mmap_alloc().
#define is_extern_segment | ( | S | ) | (get_segment_flags(S) & EXTERN_BIT) |
Definition at line 1979 of file dlmalloc.c.
Referenced by release_unused_segments(), sys_alloc(), and sys_trim().
Definition at line 2114 of file dlmalloc.c.
Referenced by sys_alloc().
#define is_granularity_aligned | ( | S | ) | (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0) |
Definition at line 2147 of file dlmalloc.c.
Definition at line 2115 of file dlmalloc.c.
Referenced by change_mparam(), internal_mallinfo(), internal_malloc_stats(), sys_alloc(), and sys_trim().
#define is_mmapped | ( | p | ) | (!((p)->head & PINUSE_BIT) && ((p)->prev_foot & IS_MMAPPED_BIT)) |
Definition at line 1754 of file dlmalloc.c.
Referenced by change_mparam(), ialloc(), internal_memalign(), and internal_realloc().
#define IS_MMAPPED_BIT (SIZE_T_ONE) |
Definition at line 1299 of file dlmalloc.c.
Referenced by change_mparam(), dlfree(), dlmallopt(), mmap_alloc(), mmap_resize(), and sys_alloc().
#define is_mmapped_segment | ( | S | ) | (get_segment_flags(S) & IS_MMAPPED_BIT) |
Definition at line 1978 of file dlmalloc.c.
Referenced by release_unused_segments(), and sys_trim().
#define is_page_aligned | ( | S | ) | (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0) |
Definition at line 2145 of file dlmalloc.c.
Referenced by sys_alloc().
#define is_small | ( | s | ) | (((s) >> SMALLBIN_SHIFT) < NSMALLBINS) |
Definition at line 2284 of file dlmalloc.c.
Referenced by change_mparam(), and mmap_resize().
#define least_bit | ( | x | ) | ((x) & -(x)) |
Definition at line 2387 of file dlmalloc.c.
Referenced by dlmalloc(), dlmallopt(), tmalloc_large(), and tmalloc_small().
#define left_bits | ( | x | ) | ((x<<1) | -(x<<1)) |
Definition at line 2390 of file dlmalloc.c.
Referenced by dlmalloc(), dlmallopt(), and tmalloc_large().
#define leftmost_child | ( | t | ) | ((t)->child[0] != 0? (t)->child[0] : (t)->child[1]) |
Definition at line 1876 of file dlmalloc.c.
Referenced by tmalloc_large(), and tmalloc_small().
#define leftshift_for_tree_index | ( | i | ) |
Definition at line 2333 of file dlmalloc.c.
Referenced by change_mparam(), and tmalloc_large().
#define M_GRANULARITY (-2) |
Definition at line 591 of file dlmalloc.c.
Referenced by change_mparam().
#define M_MMAP_THRESHOLD (-3) |
Definition at line 592 of file dlmalloc.c.
Referenced by change_mparam().
#define M_TRIM_THRESHOLD (-1) |
Definition at line 590 of file dlmalloc.c.
Referenced by change_mparam().
#define MALLINFO_FIELD_TYPE size_t |
Definition at line 580 of file dlmalloc.c.
#define MALLOC_ALIGNMENT ((size_t)8U) |
Definition at line 496 of file dlmalloc.c.
Referenced by init_mparams(), and internal_memalign().
#define MALLOC_FAILURE_ACTION errno = ENOMEM; |
Definition at line 530 of file dlmalloc.c.
Referenced by internal_memalign(), internal_realloc(), and sys_alloc().
#define malloc_getpagesize ((size_t)4096U) |
Definition at line 1240 of file dlmalloc.c.
Referenced by init_mparams().
#define mark_inuse_foot | ( | M, | |
p, | |||
s | |||
) |
Definition at line 2464 of file dlmalloc.c.
Referenced by mmap_alloc(), and mmap_resize().
Definition at line 2349 of file dlmalloc.c.
Definition at line 2353 of file dlmalloc.c.
#define MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2) |
Definition at line 1694 of file dlmalloc.c.
Referenced by dlmalloc(), dlmallopt(), internal_memalign(), internal_realloc(), and sys_trim().
#define MAX_SIZE_T (~(size_t)0) |
Definition at line 483 of file dlmalloc.c.
Referenced by dlcalloc(), dlmalloc(), dlmallopt(), init_mparams(), and sys_trim().
#define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD) |
Definition at line 2067 of file dlmalloc.c.
Referenced by dlmalloc(), and dlmallopt().
#define MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE) |
Definition at line 2066 of file dlmalloc.c.
#define MCHUNK_SIZE (sizeof(mchunk)) |
Definition at line 1670 of file dlmalloc.c.
Referenced by init_mparams().
#define mem2chunk | ( | mem | ) | ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES)) |
Definition at line 1689 of file dlmalloc.c.
Referenced by change_mparam(), dlcalloc(), dlfree(), dlmalloc_usable_size(), dlmallopt(), dlrealloc(), ialloc(), internal_memalign(), internal_realloc(), and sys_alloc().
#define MFAIL ((void*)(MAX_SIZE_T)) |
Definition at line 1288 of file dlmalloc.c.
Referenced by sys_trim().
#define MIN_CHUNK_SIZE ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) |
Definition at line 1684 of file dlmalloc.c.
Referenced by add_segment(), change_mparam(), dlmalloc(), dlmallopt(), init_mparams(), internal_memalign(), internal_realloc(), prepend_alloc(), tmalloc_large(), and tmalloc_small().
#define MIN_LARGE_SIZE (SIZE_T_ONE << TREEBIN_SHIFT) |
Definition at line 2065 of file dlmalloc.c.
Referenced by change_mparam().
#define MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE) |
Definition at line 1695 of file dlmalloc.c.
Referenced by dlmalloc(), and dlmallopt().
#define MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE)) |
Definition at line 2287 of file dlmalloc.c.
#define minsize_for_tree_index | ( | i | ) |
Definition at line 2338 of file dlmalloc.c.
Referenced by change_mparam().
#define MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) |
Definition at line 1679 of file dlmalloc.c.
#define MMAP_CLEARS 1 |
Definition at line 520 of file dlmalloc.c.
#define MMAP_FLAGS (MAP_PRIVATE) |
Definition at line 1316 of file dlmalloc.c.
#define MMAP_FOOT_PAD (FOUR_SIZE_T_SIZES) |
Definition at line 1681 of file dlmalloc.c.
Referenced by change_mparam(), dlfree(), dlmallopt(), mmap_alloc(), and mmap_resize().
#define MMAP_PROT (PROT_READ|PROT_WRITE) |
Definition at line 1304 of file dlmalloc.c.
#define MORECORE sbrk |
Definition at line 543 of file dlmalloc.c.
#define MORECORE_CONTIGUOUS 1 |
Definition at line 546 of file dlmalloc.c.
Referenced by sys_alloc().
#define MSPACES 0 |
Definition at line 492 of file dlmalloc.c.
#define next_chunk | ( | p | ) | ((mchunkptr)( ((char*)(p)) + ((p)->head & ~INUSE_BITS))) |
Definition at line 1736 of file dlmalloc.c.
Referenced by change_mparam(), dlmallopt(), internal_mallinfo(), internal_malloc_stats(), and sys_alloc().
#define next_pinuse | ( | p | ) | ((next_chunk(p)->head) & PINUSE_BIT) |
Definition at line 1740 of file dlmalloc.c.
Referenced by change_mparam().
#define NO_MALLINFO 0 |
Definition at line 577 of file dlmalloc.c.
#define NSMALLBINS (32U) |
Definition at line 2060 of file dlmalloc.c.
Referenced by change_mparam(), and init_bins().
#define NTREEBINS (32U) |
Definition at line 2061 of file dlmalloc.c.
Referenced by change_mparam(), and init_bins().
Definition at line 2426 of file dlmalloc.c.
Referenced by change_mparam(), dlfree(), dlmallopt(), internal_realloc(), tmalloc_large(), and tmalloc_small().
#define ok_cinuse | ( | p | ) | cinuse(p) |
Definition at line 2430 of file dlmalloc.c.
Referenced by dlfree(), dlmallopt(), and internal_realloc().
#define ok_magic | ( | M | ) | (1) |
Definition at line 2445 of file dlmalloc.c.
Referenced by dlfree(), dlmallopt(), and dlrealloc().
#define ok_next | ( | p, | |
n | |||
) | ((char*)(p) < (char*)(n)) |
Definition at line 2428 of file dlmalloc.c.
Referenced by dlfree(), dlmallopt(), internal_realloc(), tmalloc_large(), and tmalloc_small().
#define ok_pinuse | ( | p | ) | pinuse(p) |
Definition at line 2432 of file dlmalloc.c.
Referenced by dlfree(), dlmallopt(), and internal_realloc().
#define ONLY_MSPACES 0 |
Definition at line 486 of file dlmalloc.c.
#define overhead_for | ( | p | ) | (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD) |
Definition at line 1758 of file dlmalloc.c.
Referenced by dlmalloc_usable_size(), and internal_realloc().
#define pad_request | ( | req | ) | (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) |
Definition at line 1698 of file dlmalloc.c.
Referenced by add_segment(), dlmalloc(), and dlmallopt().
#define page_align | ( | S | ) | (((S) + (mparams.page_size)) & ~(mparams.page_size - SIZE_T_ONE)) |
Definition at line 2138 of file dlmalloc.c.
Referenced by sys_alloc().
#define pinuse | ( | p | ) | ((p)->head & PINUSE_BIT) |
Definition at line 1725 of file dlmalloc.c.
Referenced by change_mparam(), dlfree(), dlmallopt(), and prepend_alloc().
#define PINUSE_BIT (SIZE_T_ONE) |
Definition at line 1716 of file dlmalloc.c.
Referenced by change_mparam(), dlfree(), dlmalloc(), dlmallopt(), init_top(), internal_realloc(), prepend_alloc(), and sys_alloc().
#define POSTACTION | ( | M | ) |
Definition at line 2213 of file dlmalloc.c.
Referenced by dlfree(), dlmalloc(), dlmalloc_trim(), dlmallopt(), ialloc(), internal_mallinfo(), internal_malloc_stats(), internal_memalign(), and internal_realloc().
#define PREACTION | ( | M | ) | (0) |
Definition at line 2209 of file dlmalloc.c.
Referenced by dlfree(), dlmalloc(), dlmalloc_trim(), dlmallopt(), ialloc(), internal_mallinfo(), internal_malloc_stats(), internal_memalign(), and internal_realloc().
#define prev_chunk | ( | p | ) | ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) )) |
Definition at line 1737 of file dlmalloc.c.
Referenced by change_mparam().
#define PROCEED_ON_ERROR 0 |
Definition at line 508 of file dlmalloc.c.
#define RELEASE_MAGIC_INIT_LOCK | ( | ) |
Definition at line 1513 of file dlmalloc.c.
Referenced by init_mparams().
#define RELEASE_MORECORE_LOCK | ( | ) |
Definition at line 1505 of file dlmalloc.c.
Referenced by sys_alloc(), and sys_trim().
Definition at line 3021 of file dlmalloc.c.
Referenced by dlmalloc(), dlmallopt(), and tmalloc_small().
#define request2size | ( | req | ) | (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req)) |
Definition at line 1702 of file dlmalloc.c.
Referenced by ialloc(), internal_memalign(), and internal_realloc().
#define RTCHECK | ( | e | ) | (e) |
Definition at line 2454 of file dlmalloc.c.
Referenced by dlfree(), dlmallopt(), internal_realloc(), tmalloc_large(), and tmalloc_small().
#define same_or_left_bits | ( | x | ) | ((x) | -(x)) |
Definition at line 2393 of file dlmalloc.c.
Definition at line 2151 of file dlmalloc.c.
Referenced by change_mparam(), internal_mallinfo(), internal_malloc_stats(), release_unused_segments(), and sys_alloc().
#define set_foot | ( | p, | |
s | |||
) | (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s)) |
Definition at line 1744 of file dlmalloc.c.
#define set_free_with_pinuse | ( | p, | |
s, | |||
n | |||
) | (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s)) |
Definition at line 1751 of file dlmalloc.c.
Referenced by add_segment(), dlfree(), dlmallopt(), and prepend_alloc().
#define set_inuse | ( | M, | |
p, | |||
s | |||
) |
Definition at line 2467 of file dlmalloc.c.
Referenced by internal_memalign(), and internal_realloc().
#define set_inuse_and_pinuse | ( | M, | |
p, | |||
s | |||
) |
Definition at line 2472 of file dlmalloc.c.
Referenced by dlmalloc(), dlmallopt(), tmalloc_large(), and tmalloc_small().
Definition at line 2132 of file dlmalloc.c.
Referenced by dlmallopt().
Definition at line 1971 of file dlmalloc.c.
Referenced by add_segment(), dlmallopt(), and sys_alloc().
#define set_size_and_pinuse_of_free_chunk | ( | p, | |
s | |||
) | ((p)->head = (s|PINUSE_BIT), set_foot(p, s)) |
Definition at line 1747 of file dlmalloc.c.
Referenced by dlfree(), dlmalloc(), dlmallopt(), prepend_alloc(), tmalloc_large(), and tmalloc_small().
#define set_size_and_pinuse_of_inuse_chunk | ( | M, | |
p, | |||
s | |||
) | ((p)->head = (s|PINUSE_BIT|CINUSE_BIT)) |
Definition at line 2477 of file dlmalloc.c.
Referenced by add_segment(), dlmalloc(), dlmallopt(), ialloc(), prepend_alloc(), sys_alloc(), tmalloc_large(), and tmalloc_small().
Definition at line 2177 of file dlmalloc.c.
Referenced by dlfree(), and dlmallopt().
#define SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES) |
Definition at line 1264 of file dlmalloc.c.
Referenced by mmap_alloc(), and mmap_resize().
#define SIZE_T_BITSIZE (sizeof(size_t) << 3) |
Definition at line 1255 of file dlmalloc.c.
Referenced by change_mparam(), and tmalloc_large().
#define SIZE_T_ONE ((size_t)1) |
Definition at line 1260 of file dlmalloc.c.
Referenced by change_mparam(), dlpvalloc(), init_mparams(), internal_mallinfo(), internal_memalign(), sys_alloc(), sys_trim(), and tmalloc_large().
#define SIZE_T_SIZE (sizeof(size_t)) |
Definition at line 1254 of file dlmalloc.c.
Referenced by add_segment(), change_mparam(), dlmalloc(), dlmallopt(), ialloc(), mmap_alloc(), and mmap_resize().
#define SIZE_T_TWO ((size_t)2) |
Definition at line 1261 of file dlmalloc.c.
#define SIZE_T_ZERO ((size_t)0) |
Definition at line 1259 of file dlmalloc.c.
#define small_index | ( | s | ) | ((s) >> SMALLBIN_SHIFT) |
Definition at line 2285 of file dlmalloc.c.
Referenced by change_mparam(), dlmalloc(), and dlmallopt().
#define small_index2size | ( | i | ) | ((i) << SMALLBIN_SHIFT) |
Definition at line 2286 of file dlmalloc.c.
Referenced by dlmalloc(), and dlmallopt().
Definition at line 2290 of file dlmalloc.c.
Referenced by change_mparam(), dlmalloc(), dlmallopt(), and init_bins().
#define SMALLBIN_SHIFT (3U) |
Definition at line 2062 of file dlmalloc.c.
#define SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT) |
Definition at line 2063 of file dlmalloc.c.
Definition at line 2351 of file dlmalloc.c.
Referenced by change_mparam().
#define TOP_FOOT_SIZE (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE) |
Definition at line 2187 of file dlmalloc.c.
Referenced by add_segment(), change_mparam(), dlmallopt(), init_top(), internal_mallinfo(), internal_malloc_stats(), release_unused_segments(), sys_alloc(), and sys_trim().
Definition at line 2291 of file dlmalloc.c.
Referenced by change_mparam(), init_bins(), tmalloc_large(), and tmalloc_small().
#define TREEBIN_SHIFT (8U) |
Definition at line 2064 of file dlmalloc.c.
Definition at line 2355 of file dlmalloc.c.
Referenced by change_mparam().
#define TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1) |
Definition at line 1262 of file dlmalloc.c.
Definition at line 3180 of file dlmalloc.c.
Referenced by dlfree(), dlmallopt(), and prepend_alloc().
Definition at line 3003 of file dlmalloc.c.
Referenced by dlmalloc(), and dlmallopt().
#define unlink_large_chunk | ( | M, | |
X | |||
) |
Definition at line 3103 of file dlmalloc.c.
Referenced by release_unused_segments(), tmalloc_large(), and tmalloc_small().
Definition at line 2983 of file dlmalloc.c.
#define USAGE_ERROR_ACTION | ( | m, | |
p | |||
) | ABORT |
Definition at line 2244 of file dlmalloc.c.
Referenced by dlfree(), dlmallopt(), dlrealloc(), and internal_realloc().
#define USE_BUILTIN_FFS 0 |
Definition at line 571 of file dlmalloc.c.
#define USE_DEV_RANDOM 0 |
Definition at line 574 of file dlmalloc.c.
#define use_lock | ( | M | ) | ((M)->mflags & USE_LOCK_BIT) |
Definition at line 2121 of file dlmalloc.c.
#define USE_LOCK_BIT (0U) |
Definition at line 1496 of file dlmalloc.c.
Referenced by init_mparams().
#define USE_LOCKS 0 |
Definition at line 511 of file dlmalloc.c.
#define use_mmap | ( | M | ) | ((M)->mflags & USE_MMAP_BIT) |
Definition at line 2125 of file dlmalloc.c.
Referenced by change_mparam(), ialloc(), and sys_alloc().
#define USE_MMAP_BIT (SIZE_T_ONE) |
Definition at line 1300 of file dlmalloc.c.
Referenced by init_mparams().
#define use_noncontiguous | ( | M | ) | ((M)->mflags & USE_NONCONTIGUOUS_BIT) |
Definition at line 2129 of file dlmalloc.c.
Referenced by sys_alloc().
#define USE_NONCONTIGUOUS_BIT (4U) |
Definition at line 1413 of file dlmalloc.c.
Referenced by init_mparams().
typedef size_t bindex_t |
Definition at line 1664 of file dlmalloc.c.
typedef unsigned int binmap_t |
Definition at line 1665 of file dlmalloc.c.
typedef unsigned int flag_t |
Definition at line 1666 of file dlmalloc.c.
typedef struct malloc_chunk mchunk |
Definition at line 1661 of file dlmalloc.c.
typedef struct malloc_chunk* mchunkptr |
Definition at line 1662 of file dlmalloc.c.
typedef struct malloc_segment msegment |
Definition at line 1981 of file dlmalloc.c.
typedef struct malloc_segment* msegmentptr |
Definition at line 1982 of file dlmalloc.c.
typedef struct malloc_state* mstate |
Definition at line 2090 of file dlmalloc.c.
typedef struct malloc_chunk* sbinptr |
Definition at line 1663 of file dlmalloc.c.
typedef struct malloc_tree_chunk* tbinptr |
Definition at line 1873 of file dlmalloc.c.
typedef struct malloc_tree_chunk tchunk |
Definition at line 1871 of file dlmalloc.c.
typedef struct malloc_tree_chunk* tchunkptr |
Definition at line 1872 of file dlmalloc.c.
Definition at line 3366 of file dlmalloc.c.
References align_offset, assert, malloc_segment::base, check_top_chunk, chunk2mem, CHUNK_ALIGN_MASK, chunk_plus_offset, FENCEPOST_HEAD, FOUR_SIZE_T_SIZES, malloc_chunk::head, init_top(), insert_chunk, is_aligned, MIN_CHUNK_SIZE, malloc_segment::next, pad_request, malloc_state::seg, segment_holding(), set_free_with_pinuse, set_segment_flags, set_size_and_pinuse_of_inuse_chunk, malloc_segment::size, SIZE_T_SIZE, malloc_state::top, and TOP_FOOT_SIZE.
Referenced by sys_alloc().
|
static |
Definition at line 2590 of file dlmalloc.c.
References align_as_chunk, assert, malloc_segment::base, malloc_chunk::bk, malloc_tree_chunk::child, chunk2mem, CHUNK_ALIGN_MASK, chunk_plus_offset, chunksize, cinuse, CINUSE_BIT, compute_tree_index, malloc_state::dv, malloc_state::dvsize, malloc_chunk::fd, malloc_tree_chunk::fd, FENCEPOST_HEAD, malloc_state::footprint, malloc_params::granularity, malloc_chunk::head, malloc_tree_chunk::index, init_mparams(), is_aligned, is_initialized, is_mmapped, IS_MMAPPED_BIT, is_small, leftshift_for_tree_index, len, M_GRANULARITY, M_MMAP_THRESHOLD, M_TRIM_THRESHOLD, malloc_state::max_footprint, mem2chunk, MIN_CHUNK_SIZE, MIN_LARGE_SIZE, minsize_for_tree_index, MMAP_FOOT_PAD, malloc_params::mmap_threshold, mparams, malloc_segment::next, next_chunk, next_pinuse, NSMALLBINS, NTREEBINS, ok_address, malloc_params::page_size, pinuse, PINUSE_BIT, prev_chunk, malloc_chunk::prev_foot, malloc_state::seg, segment_holding(), segment_holds, size, malloc_segment::size, SIZE_T_BITSIZE, SIZE_T_ONE, SIZE_T_SIZE, small_index, smallbin_at, malloc_state::smallmap, smallmap_is_marked, malloc_state::top, TOP_FOOT_SIZE, malloc_state::topsize, treebin_at, malloc_state::treemap, treemap_is_marked, malloc_params::trim_threshold, use_mmap, and val.
Referenced by dlmallopt().
void * dlcalloc | ( | size_t | n_elements, |
size_t | elem_size | ||
) |
Definition at line 4355 of file dlmalloc.c.
References calloc_must_clear, dlmalloc, MAX_SIZE_T, and mem2chunk.
void dlfree | ( | void * | mem | ) |
Definition at line 4255 of file dlmalloc.c.
References CALL_MUNMAP, check_free_chunk, check_inuse_chunk, chunk_minus_offset, chunk_plus_offset, chunksize, cinuse, malloc_state::dv, malloc_state::dvsize, fm, malloc_state::footprint, malloc_chunk::head, insert_chunk, INUSE_BITS, IS_MMAPPED_BIT, mem2chunk, MMAP_FOOT_PAD, ok_address, ok_cinuse, ok_magic, ok_next, ok_pinuse, pinuse, PINUSE_BIT, POSTACTION, PREACTION, malloc_chunk::prev_foot, RTCHECK, set_free_with_pinuse, set_size_and_pinuse_of_free_chunk, should_trim, sys_trim(), malloc_state::top, malloc_state::topsize, unlink_chunk, and USAGE_ERROR_ACTION.
void** dlindependent_calloc | ( | size_t | , |
size_t | , | ||
void ** | |||
) |
void** dlindependent_calloc | ( | size_t | n_elements, |
size_t | elem_size, | ||
void * | chunks[] | ||
) |
Definition at line 4397 of file dlmalloc.c.
void** dlindependent_comalloc | ( | size_t | , |
size_t * | , | ||
void ** | |||
) |
void** dlindependent_comalloc | ( | size_t | n_elements, |
size_t | sizes[], | ||
void * | chunks[] | ||
) |
Definition at line 4403 of file dlmalloc.c.
struct mallinfo dlmallinfo | ( | void | ) |
Definition at line 4440 of file dlmalloc.c.
References gm, and internal_mallinfo().
void * dlmalloc | ( | size_t | bytes | ) |
Definition at line 4123 of file dlmalloc.c.
References assert, check_malloced_chunk, check_top_chunk, chunk2mem, chunk_plus_offset, chunksize, compute_bit2idx, malloc_chunk::fd, gm, malloc_chunk::head, idx2bit, least_bit, left_bits, MAX_REQUEST, MAX_SIZE_T, MAX_SMALL_REQUEST, MIN_CHUNK_SIZE, MIN_REQUEST, pad_request, PINUSE_BIT, POSTACTION, PREACTION, replace_dv, set_inuse_and_pinuse, set_size_and_pinuse_of_free_chunk, set_size_and_pinuse_of_inuse_chunk, SIZE_T_SIZE, small_index, small_index2size, smallbin_at, sys_alloc(), tmalloc_large(), tmalloc_small(), and unlink_first_small_chunk.
size_t dlmalloc_footprint | ( | void | ) |
Definition at line 4431 of file dlmalloc.c.
References gm.
size_t dlmalloc_max_footprint | ( | void | ) |
Definition at line 4435 of file dlmalloc.c.
References gm.
void dlmalloc_stats | ( | void | ) |
Definition at line 4445 of file dlmalloc.c.
References gm, and internal_malloc_stats().
int dlmalloc_trim | ( | size_t | pad | ) |
Definition at line 4422 of file dlmalloc.c.
References gm, POSTACTION, PREACTION, result, and sys_trim().
size_t dlmalloc_usable_size | ( | void * | mem | ) |
Definition at line 4449 of file dlmalloc.c.
References chunksize, cinuse, mem2chunk, and overhead_for.
int dlmallopt | ( | int | param_number, |
int | value | ||
) |
Definition at line 4458 of file dlmalloc.c.
References align_as_chunk, assert, malloc_segment::base, CALL_MMAP, CALL_MUNMAP, calloc_must_clear, change_mparam(), check_free_chunk, check_inuse_chunk, check_malloced_chunk, check_top_chunk, chunk2mem, chunk_minus_offset, chunk_plus_offset, chunksize, cinuse, CINUSE_BIT, CMFAIL, compute_bit2idx, malloc_params::default_mflags, disable_contiguous, malloc_state::dv, malloc_state::dvsize, EXTERN_BIT, malloc_chunk::fd, fm, malloc_state::footprint, get_segment_flags, malloc_params::granularity, granularity_align, malloc_chunk::head, ialloc(), idx2bit, init_bins(), init_mparams(), init_top(), INITIAL_LOCK, insert_chunk, internal_mallinfo(), internal_malloc, internal_malloc_stats(), internal_memalign(), internal_realloc(), INUSE_BITS, IS_MMAPPED_BIT, malloc_state::least_addr, least_bit, left_bits, malloc_state::magic, malloc_params::magic, malloc_state::max_footprint, MAX_REQUEST, MAX_SIZE_T, MAX_SMALL_REQUEST, mem2chunk, malloc_state::mflags, MIN_CHUNK_SIZE, MIN_REQUEST, MMAP_FOOT_PAD, mparams, malloc_segment::next, next_chunk, ok_address, ok_cinuse, ok_magic, ok_next, ok_pinuse, pad_request, malloc_params::page_size, pinuse, PINUSE_BIT, POSTACTION, PREACTION, malloc_chunk::prev_foot, replace_dv, result, RTCHECK, malloc_state::seg, set_free_with_pinuse, set_inuse_and_pinuse, set_lock, set_segment_flags, set_size_and_pinuse_of_free_chunk, set_size_and_pinuse_of_inuse_chunk, should_trim, size, malloc_segment::size, SIZE_T_SIZE, small_index, small_index2size, smallbin_at, malloc_state::smallmap, sys_alloc(), sys_trim(), tmalloc_large(), tmalloc_small(), malloc_state::top, TOP_FOOT_SIZE, malloc_state::topsize, malloc_state::treemap, unlink_chunk, unlink_first_small_chunk, and USAGE_ERROR_ACTION.
void * dlmemalign | ( | size_t | alignment, |
size_t | bytes | ||
) |
Definition at line 4393 of file dlmalloc.c.
References gm, and internal_memalign().
void * dlpvalloc | ( | size_t | bytes | ) |
Definition at line 4415 of file dlmalloc.c.
References dlmemalign, init_mparams(), mparams, malloc_params::page_size, and SIZE_T_ONE.
void * dlrealloc | ( | void * | oldmem, |
size_t | bytes | ||
) |
Definition at line 4370 of file dlmalloc.c.
References dlfree, dlmalloc, gm, internal_realloc(), mem2chunk, ok_magic, and USAGE_ERROR_ACTION.
void * dlvalloc | ( | size_t | bytes | ) |
Definition at line 4408 of file dlmalloc.c.
References dlmemalign, init_mparams(), mparams, and malloc_params::page_size.
|
static |
Definition at line 2166 of file dlmalloc.c.
References malloc_segment::base, malloc_segment::next, malloc_state::seg, and malloc_segment::size.
Referenced by sys_trim().
|
static |
Definition at line 3992 of file dlmalloc.c.
References assert, check_inuse_chunk, chunk2mem, CHUNK_OVERHEAD, chunk_plus_offset, chunksize, disable_mmap, enable_mmap, internal_malloc, is_mmapped, mem2chunk, POSTACTION, PREACTION, request2size, set_size_and_pinuse_of_inuse_chunk, size, SIZE_T_SIZE, and use_mmap.
Referenced by dlindependent_calloc(), dlindependent_comalloc(), and dlmallopt().
|
static |
Definition at line 3294 of file dlmalloc.c.
References malloc_segment::base, bin, malloc_chunk::bk, malloc_state::dv, malloc_state::dvsize, malloc_chunk::fd, malloc_segment::next, NSMALLBINS, NTREEBINS, malloc_state::seg, malloc_segment::size, smallbin_at, malloc_state::smallbins, malloc_state::top, malloc_state::topsize, treebin_at, and malloc_state::treebins.
Referenced by dlmallopt(), and sys_alloc().
|
static |
Definition at line 2509 of file dlmalloc.c.
References ABORT, ACQUIRE_MAGIC_INIT_LOCK, buf, DEFAULT_GRANULARITY, malloc_params::default_mflags, DEFAULT_MMAP_THRESHOLD, DEFAULT_TRIM_THRESHOLD, gm, malloc_params::granularity, INITIAL_LOCK, malloc_params::magic, MALLOC_ALIGNMENT, malloc_getpagesize, MAX_SIZE_T, MCHUNK_SIZE, MIN_CHUNK_SIZE, malloc_params::mmap_threshold, mparams, malloc_params::page_size, RELEASE_MAGIC_INIT_LOCK, SIZE_T_ONE, malloc_params::trim_threshold, USE_LOCK_BIT, USE_MMAP_BIT, and USE_NONCONTIGUOUS_BIT.
Referenced by change_mparam(), dlmallopt(), dlpvalloc(), dlvalloc(), and sys_alloc().
Definition at line 3279 of file dlmalloc.c.
References align_offset, chunk2mem, chunk_plus_offset, malloc_chunk::head, mparams, PINUSE_BIT, malloc_state::top, TOP_FOOT_SIZE, malloc_state::topsize, malloc_state::trim_check, and malloc_params::trim_threshold.
Referenced by add_segment(), dlmallopt(), sys_alloc(), and sys_trim().
Definition at line 2883 of file dlmalloc.c.
References align_as_chunk, mallinfo::arena, malloc_segment::base, check_malloc_state, chunksize, cinuse, FENCEPOST_HEAD, malloc_state::footprint, mallinfo::fordblks, mallinfo::hblkhd, malloc_chunk::head, is_initialized, mallinfo::keepcost, malloc_state::max_footprint, malloc_segment::next, next_chunk, mallinfo::ordblks, POSTACTION, PREACTION, malloc_state::seg, segment_holds, SIZE_T_ONE, malloc_state::top, TOP_FOOT_SIZE, malloc_state::topsize, mallinfo::uordblks, and mallinfo::usmblks.
Referenced by dlmallinfo(), and dlmallopt().
|
static |
Definition at line 2922 of file dlmalloc.c.
References align_as_chunk, malloc_segment::base, check_malloc_state, chunksize, cinuse, FENCEPOST_HEAD, malloc_state::footprint, malloc_chunk::head, is_initialized, malloc_state::max_footprint, malloc_segment::next, next_chunk, POSTACTION, PREACTION, malloc_state::seg, segment_holds, malloc_state::top, TOP_FOOT_SIZE, and malloc_state::topsize.
Referenced by dlmalloc_stats(), and dlmallopt().
|
static |
Definition at line 3905 of file dlmalloc.c.
References assert, check_inuse_chunk, chunk2mem, CHUNK_OVERHEAD, chunk_plus_offset, chunksize, CINUSE_BIT, malloc_chunk::head, internal_free, internal_malloc, is_mmapped, MALLOC_ALIGNMENT, MALLOC_FAILURE_ACTION, MAX_REQUEST, mem2chunk, MIN_CHUNK_SIZE, POSTACTION, PREACTION, malloc_chunk::prev_foot, request2size, set_inuse, size, and SIZE_T_ONE.
Referenced by dlmallopt(), and dlmemalign().
|
static |
Definition at line 3834 of file dlmalloc.c.
References check_inuse_chunk, chunk2mem, chunk_plus_offset, chunksize, malloc_chunk::head, internal_free, internal_malloc, is_mmapped, MALLOC_FAILURE_ACTION, MAX_REQUEST, mem2chunk, memcpy, MIN_CHUNK_SIZE, mmap_resize(), ok_address, ok_cinuse, ok_next, ok_pinuse, overhead_for, PINUSE_BIT, POSTACTION, PREACTION, request2size, RTCHECK, set_inuse, malloc_state::top, malloc_state::topsize, and USAGE_ERROR_ACTION.
Referenced by dlmallopt(), and dlrealloc().
|
static |
Definition at line 3215 of file dlmalloc.c.
References align_offset, assert, check_mmapped_chunk, chunk2mem, CHUNK_ALIGN_MASK, chunk_plus_offset, CINUSE_BIT, CMFAIL, DIRECT_MMAP, FENCEPOST_HEAD, malloc_state::footprint, granularity_align, is_aligned, IS_MMAPPED_BIT, malloc_state::least_addr, mark_inuse_foot, malloc_state::max_footprint, MMAP_FOOT_PAD, malloc_chunk::prev_foot, SIX_SIZE_T_SIZES, and SIZE_T_SIZE.
Referenced by sys_alloc().
Definition at line 3242 of file dlmalloc.c.
References CALL_MREMAP, check_mmapped_chunk, CHUNK_ALIGN_MASK, chunk_plus_offset, chunksize, CINUSE_BIT, CMFAIL, FENCEPOST_HEAD, malloc_state::footprint, malloc_params::granularity, granularity_align, malloc_chunk::head, IS_MMAPPED_BIT, is_small, malloc_state::least_addr, mark_inuse_foot, malloc_state::max_footprint, MMAP_FOOT_PAD, mparams, malloc_chunk::prev_foot, SIX_SIZE_T_SIZES, and SIZE_T_SIZE.
Referenced by internal_realloc().
|
static |
Definition at line 3323 of file dlmalloc.c.
References align_as_chunk, assert, check_free_chunk, check_malloced_chunk, check_top_chunk, chunk2mem, chunk_plus_offset, chunksize, cinuse, malloc_state::dv, malloc_state::dvsize, malloc_chunk::head, insert_chunk, MIN_CHUNK_SIZE, pinuse, PINUSE_BIT, set_free_with_pinuse, set_size_and_pinuse_of_free_chunk, set_size_and_pinuse_of_inuse_chunk, malloc_state::top, malloc_state::topsize, and unlink_chunk.
Referenced by sys_alloc().
|
static |
Definition at line 3615 of file dlmalloc.c.
References align_as_chunk, assert, malloc_segment::base, CALL_MUNMAP, chunksize, cinuse, malloc_state::dv, malloc_state::dvsize, malloc_state::footprint, insert_large_chunk, is_extern_segment, is_mmapped_segment, malloc_segment::next, malloc_state::seg, segment_holds, size, malloc_segment::size, TOP_FOOT_SIZE, and unlink_large_chunk.
Referenced by sys_trim().
|
static |
Definition at line 2155 of file dlmalloc.c.
References malloc_segment::base, malloc_segment::next, malloc_state::seg, and malloc_segment::size.
Referenced by add_segment(), change_mparam(), sys_alloc(), and sys_trim().
|
static |
Definition at line 3421 of file dlmalloc.c.
References ACQUIRE_MORECORE_LOCK, add_segment(), malloc_segment::base, CALL_MMAP, CALL_MORECORE, check_malloced_chunk, check_segment_merge, check_top_chunk, chunk2mem, chunk_plus_offset, CMFAIL, disable_contiguous, malloc_state::footprint, get_segment_flags, granularity_align, HALF_MAX_SIZE_T, HAVE_MMAP, HAVE_MORECORE, malloc_chunk::head, init_bins(), init_mparams(), init_top(), is_extern_segment, is_global, is_initialized, IS_MMAPPED_BIT, is_page_aligned, malloc_state::least_addr, malloc_state::magic, malloc_params::magic, MALLOC_FAILURE_ACTION, malloc_state::max_footprint, mem2chunk, mmap_alloc(), malloc_params::mmap_threshold, MORECORE_CONTIGUOUS, mparams, malloc_segment::next, next_chunk, page_align, PINUSE_BIT, prepend_alloc(), RELEASE_MORECORE_LOCK, malloc_state::seg, segment_holding(), segment_holds, set_segment_flags, set_size_and_pinuse_of_inuse_chunk, malloc_segment::size, SIZE_T_ONE, malloc_state::top, TOP_FOOT_SIZE, malloc_state::topsize, use_mmap, and use_noncontiguous.
Referenced by dlmalloc(), and dlmallopt().
|
static |
Definition at line 3655 of file dlmalloc.c.
References ACQUIRE_MORECORE_LOCK, malloc_segment::base, CALL_MORECORE, CALL_MREMAP, CALL_MUNMAP, check_top_chunk, CMFAIL, malloc_state::footprint, malloc_params::granularity, HALF_MAX_SIZE_T, has_segment_link(), HAVE_MMAP, HAVE_MORECORE, init_top(), is_extern_segment, is_initialized, is_mmapped_segment, MAX_REQUEST, MAX_SIZE_T, MFAIL, mparams, RELEASE_MORECORE_LOCK, release_unused_segments(), segment_holding(), malloc_segment::size, SIZE_T_ONE, malloc_state::top, TOP_FOOT_SIZE, malloc_state::topsize, and malloc_state::trim_check.
Referenced by dlfree(), dlmalloc_trim(), and dlmallopt().
|
static |
Definition at line 3721 of file dlmalloc.c.
References assert, malloc_tree_chunk::child, chunk2mem, chunk_plus_offset, chunksize, compute_bit2idx, compute_tree_index, CORRUPTION_ERROR_ACTION, malloc_state::dvsize, idx2bit, insert_chunk, least_bit, left_bits, leftmost_child, leftshift_for_tree_index, MIN_CHUNK_SIZE, ok_address, ok_next, RTCHECK, set_inuse_and_pinuse, set_size_and_pinuse_of_free_chunk, set_size_and_pinuse_of_inuse_chunk, SIZE_T_BITSIZE, SIZE_T_ONE, treebin_at, malloc_state::treemap, and unlink_large_chunk.
Referenced by dlmalloc(), and dlmallopt().
|
static |
Definition at line 3794 of file dlmalloc.c.
References assert, chunk2mem, chunk_plus_offset, chunksize, compute_bit2idx, CORRUPTION_ERROR_ACTION, least_bit, leftmost_child, MIN_CHUNK_SIZE, ok_address, ok_next, replace_dv, RTCHECK, set_inuse_and_pinuse, set_size_and_pinuse_of_free_chunk, set_size_and_pinuse_of_inuse_chunk, treebin_at, malloc_state::treemap, and unlink_large_chunk.
Referenced by dlmalloc(), and dlmallopt().
|
static |
Definition at line 2112 of file dlmalloc.c.
|
static |
Definition at line 1317 of file dlmalloc.c.
|
static |
Definition at line 2109 of file dlmalloc.c.
Referenced by change_mparam(), dlmallopt(), dlpvalloc(), dlvalloc(), init_mparams(), init_top(), mmap_resize(), sys_alloc(), and sys_trim().