SDL
2.0
|
#include "../SDL_internal.h"
#include "SDL_stdinc.h"
#include "SDL_atomic.h"
#include "SDL_error.h"
#include <windows.h>
Go to the source code of this file.
Data Structures | |
struct | mallinfo |
struct | sbinptr |
struct | tbinptr |
struct | msegmentptr |
struct | mstate |
struct | malloc_params |
Typedefs | |
typedef size_t | bindex_t |
typedef unsigned int | binmap_t |
typedef unsigned int | flag_t |
Variables | |
static MLOCK_T | magic_init_mutex |
static struct malloc_params | mparams |
static struct malloc_state | _gm_ |
struct { | |
SDL_malloc_func malloc_func | |
SDL_calloc_func calloc_func | |
SDL_realloc_func realloc_func | |
SDL_free_func free_func | |
SDL_atomic_t num_allocations | |
} | s_mem |
#define ABORT |
Definition at line 39 of file SDL_malloc.c.
Referenced by init_mparams().
#define ABORT_ON_ASSERT_FAILURE 1 |
Definition at line 540 of file SDL_malloc.c.
#define ACQUIRE_LOCK | ( | l | ) | win32_acquire_lock(l) |
Definition at line 1494 of file SDL_malloc.c.
#define ACQUIRE_MAGIC_INIT_LOCK | ( | ) | ACQUIRE_LOCK(&magic_init_mutex); |
Definition at line 1517 of file SDL_malloc.c.
Referenced by init_mparams().
#define ACQUIRE_MORECORE_LOCK | ( | ) |
Definition at line 1512 of file SDL_malloc.c.
Referenced by sys_alloc(), and sys_trim().
#define align_as_chunk | ( | A | ) | (mchunkptr)((A) + align_offset(chunk2mem(A))) |
Definition at line 1700 of file SDL_malloc.c.
Referenced by change_mparam(), dlmallopt(), internal_mallinfo(), internal_malloc_stats(), prepend_alloc(), and release_unused_segments().
#define align_offset | ( | A | ) |
Definition at line 1317 of file SDL_malloc.c.
Referenced by add_segment(), init_top(), and mmap_alloc().
#define assert | ( | x | ) |
Definition at line 1219 of file SDL_malloc.c.
Referenced by add_segment(), change_mparam(), dlmalloc(), dlmallopt(), ialloc(), internal_memalign(), mmap_alloc(), prepend_alloc(), release_unused_segments(), tmalloc_large(), and tmalloc_small().
#define bit_for_tree_index | ( | i | ) | (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2) |
Definition at line 2310 of file SDL_malloc.c.
Definition at line 1408 of file SDL_malloc.c.
Referenced by dlmallopt(), and sys_alloc().
#define CALL_MORECORE | ( | S | ) | MFAIL |
Definition at line 1423 of file SDL_malloc.c.
Referenced by sys_alloc(), and sys_trim().
Definition at line 1417 of file SDL_malloc.c.
Referenced by mmap_resize(), and sys_trim().
#define CALL_MUNMAP | ( | a, | |
s | |||
) | win32munmap((a), (s)) |
Definition at line 1409 of file SDL_malloc.c.
Referenced by dlfree(), dlmallopt(), release_unused_segments(), and sys_trim().
#define calloc_must_clear | ( | p | ) | (1) |
Definition at line 1774 of file SDL_malloc.c.
Referenced by dlcalloc(), and dlmallopt().
#define check_free_chunk | ( | M, | |
P | |||
) |
Definition at line 2234 of file SDL_malloc.c.
Referenced by dlfree(), dlmallopt(), and prepend_alloc().
#define check_inuse_chunk | ( | M, | |
P | |||
) |
Definition at line 2235 of file SDL_malloc.c.
Referenced by dlfree(), dlmallopt(), ialloc(), internal_memalign(), and internal_realloc().
#define check_malloc_state | ( | M | ) |
Definition at line 2238 of file SDL_malloc.c.
Referenced by internal_mallinfo(), and internal_malloc_stats().
#define check_malloced_chunk | ( | M, | |
P, | |||
N | |||
) |
Definition at line 2236 of file SDL_malloc.c.
Referenced by dlmalloc(), dlmallopt(), prepend_alloc(), and sys_alloc().
#define check_mmapped_chunk | ( | M, | |
P | |||
) |
Definition at line 2237 of file SDL_malloc.c.
Referenced by mmap_alloc(), and mmap_resize().
#define check_top_chunk | ( | M, | |
P | |||
) |
Definition at line 2239 of file SDL_malloc.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 1697 of file SDL_malloc.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 1311 of file SDL_malloc.c.
Referenced by add_segment(), change_mparam(), mmap_alloc(), and mmap_resize().
Definition at line 1742 of file SDL_malloc.c.
Referenced by dlfree(), and dlmallopt().
#define CHUNK_OVERHEAD (SIZE_T_SIZE) |
Definition at line 1684 of file SDL_malloc.c.
Referenced by ialloc(), and internal_memalign().
Definition at line 1741 of file SDL_malloc.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 1735 of file SDL_malloc.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 1733 of file SDL_malloc.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 1726 of file SDL_malloc.c.
Referenced by change_mparam(), dlmallopt(), internal_memalign(), mmap_alloc(), and mmap_resize().
#define clear_cinuse | ( | p | ) | ((p)->head &= ~CINUSE_BIT) |
Definition at line 1738 of file SDL_malloc.c.
#define clear_pinuse | ( | p | ) | ((p)->head &= ~PINUSE_BIT) |
Definition at line 1737 of file SDL_malloc.c.
Definition at line 2331 of file SDL_malloc.c.
Definition at line 2335 of file SDL_malloc.c.
#define CMFAIL ((char*)(MFAIL)) /* defined for convenience */ |
Definition at line 1332 of file SDL_malloc.c.
Referenced by dlmallopt(), mmap_alloc(), mmap_resize(), sys_alloc(), and sys_trim().
#define compute_bit2idx | ( | X, | |
I | |||
) |
Definition at line 2353 of file SDL_malloc.c.
Referenced by dlmalloc(), dlmallopt(), tmalloc_large(), and tmalloc_small().
#define compute_tree_index | ( | S, | |
I | |||
) |
Definition at line 2290 of file SDL_malloc.c.
Referenced by change_mparam(), and tmalloc_large().
Definition at line 2221 of file SDL_malloc.c.
Referenced by tmalloc_large(), and tmalloc_small().
#define DEFAULT_GRANULARITY ((size_t)64U * (size_t)1024U) |
Definition at line 588 of file SDL_malloc.c.
Referenced by init_mparams().
#define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U) |
Definition at line 600 of file SDL_malloc.c.
Referenced by init_mparams().
#define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U) |
Definition at line 593 of file SDL_malloc.c.
Referenced by init_mparams().
#define DIRECT_MMAP | ( | s | ) | win32direct_mmap(s) |
Definition at line 1410 of file SDL_malloc.c.
Referenced by mmap_alloc().
#define disable_contiguous | ( | M | ) | ((M)->mflags |= USE_NONCONTIGUOUS_BIT) |
Definition at line 2107 of file SDL_malloc.c.
Referenced by dlmallopt(), and sys_alloc().
#define disable_lock | ( | M | ) | ((M)->mflags &= ~USE_LOCK_BIT) |
Definition at line 2100 of file SDL_malloc.c.
#define disable_mmap | ( | M | ) | ((M)->mflags &= ~USE_MMAP_BIT) |
Definition at line 2104 of file SDL_malloc.c.
Referenced by ialloc().
#define enable_lock | ( | M | ) | ((M)->mflags |= USE_LOCK_BIT) |
Definition at line 2099 of file SDL_malloc.c.
#define enable_mmap | ( | M | ) | ((M)->mflags |= USE_MMAP_BIT) |
Definition at line 2103 of file SDL_malloc.c.
Referenced by ialloc().
#define EXTERN_BIT (8U) |
Definition at line 1430 of file SDL_malloc.c.
Referenced by dlmallopt().
#define FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE) |
Definition at line 1730 of file SDL_malloc.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 534 of file SDL_malloc.c.
#define FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2) |
Definition at line 1306 of file SDL_malloc.c.
Referenced by add_segment().
Definition at line 1752 of file SDL_malloc.c.
#define GLOBALLY_INITIALIZE | ( | ) | (mparams.page_size == 0 && init_mparams()) |
Definition at line 2183 of file SDL_malloc.c.
#define gm (&_gm_) |
Definition at line 2090 of file SDL_malloc.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 2119 of file SDL_malloc.c.
Referenced by dlmallopt(), mmap_alloc(), mmap_resize(), and sys_alloc().
#define HALF_MAX_SIZE_T (MAX_SIZE_T / 2U) |
Definition at line 1308 of file SDL_malloc.c.
Referenced by sys_alloc(), and sys_trim().
#define HAVE_MMAP 1 |
Definition at line 491 of file SDL_malloc.c.
Referenced by sys_alloc(), and sys_trim().
#define HAVE_MORECORE 0 |
Definition at line 492 of file SDL_malloc.c.
Referenced by sys_alloc(), and sys_trim().
#define HAVE_MREMAP 0 |
Definition at line 561 of file SDL_malloc.c.
Definition at line 2327 of file SDL_malloc.c.
Referenced by dlmalloc(), dlmallopt(), and tmalloc_large().
#define INITIAL_LOCK | ( | l | ) | *(l)=0 |
Definition at line 1493 of file SDL_malloc.c.
Referenced by dlmallopt(), and init_mparams().
#define INSECURE 0 |
Definition at line 549 of file SDL_malloc.c.
#define insert_chunk | ( | M, | |
P, | |||
S | |||
) |
Definition at line 3186 of file SDL_malloc.c.
Referenced by add_segment(), dlfree(), dlmallopt(), prepend_alloc(), and tmalloc_large().
#define insert_large_chunk | ( | M, | |
X, | |||
S | |||
) |
Definition at line 3045 of file SDL_malloc.c.
Referenced by release_unused_segments().
#define insert_small_chunk | ( | M, | |
P, | |||
S | |||
) |
Definition at line 2974 of file SDL_malloc.c.
Definition at line 3208 of file SDL_malloc.c.
Referenced by internal_memalign(), and internal_realloc().
Definition at line 3207 of file SDL_malloc.c.
Referenced by dlmallopt(), ialloc(), internal_memalign(), and internal_realloc().
#define INUSE_BITS (PINUSE_BIT|CINUSE_BIT) |
Definition at line 1727 of file SDL_malloc.c.
Referenced by dlfree(), and dlmallopt().
#define is_aligned | ( | A | ) | (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0) |
Definition at line 1314 of file SDL_malloc.c.
Referenced by add_segment(), change_mparam(), and mmap_alloc().
#define is_extern_segment | ( | S | ) | ((S)->sflags & EXTERN_BIT) |
Definition at line 1954 of file SDL_malloc.c.
Referenced by release_unused_segments(), sys_alloc(), and sys_trim().
#define is_global | ( | M | ) | ((M) == &_gm_) |
Definition at line 2091 of file SDL_malloc.c.
Referenced by sys_alloc().
#define is_granularity_aligned | ( | S | ) | (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0) |
Definition at line 2124 of file SDL_malloc.c.
#define is_initialized | ( | M | ) | ((M)->top != 0) |
Definition at line 2092 of file SDL_malloc.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 1763 of file SDL_malloc.c.
Referenced by change_mparam(), ialloc(), internal_memalign(), and internal_realloc().
#define IS_MMAPPED_BIT (SIZE_T_ONE) |
Definition at line 1342 of file SDL_malloc.c.
Referenced by change_mparam(), dlfree(), dlmallopt(), mmap_alloc(), mmap_resize(), and sys_alloc().
#define is_mmapped_segment | ( | S | ) | ((S)->sflags & IS_MMAPPED_BIT) |
Definition at line 1953 of file SDL_malloc.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 2122 of file SDL_malloc.c.
Referenced by sys_alloc().
#define is_small | ( | s | ) | (((s) >> SMALLBIN_SHIFT) < NSMALLBINS) |
Definition at line 2265 of file SDL_malloc.c.
Referenced by change_mparam(), and mmap_resize().
#define LACKS_ERRNO_H |
Definition at line 499 of file SDL_malloc.c.
#define LACKS_FCNTL_H |
Definition at line 500 of file SDL_malloc.c.
#define LACKS_STDIO_H |
Definition at line 35 of file SDL_malloc.c.
#define LACKS_STDLIB_H |
Definition at line 38 of file SDL_malloc.c.
#define LACKS_STRING_H |
Definition at line 496 of file SDL_malloc.c.
#define LACKS_STRING_H |
Definition at line 496 of file SDL_malloc.c.
#define LACKS_STRINGS_H |
Definition at line 497 of file SDL_malloc.c.
#define LACKS_STRINGS_H |
Definition at line 497 of file SDL_malloc.c.
#define LACKS_SYS_MMAN_H |
Definition at line 495 of file SDL_malloc.c.
#define LACKS_SYS_PARAM_H |
Definition at line 494 of file SDL_malloc.c.
#define LACKS_SYS_TYPES_H |
Definition at line 498 of file SDL_malloc.c.
#define LACKS_SYS_TYPES_H |
Definition at line 498 of file SDL_malloc.c.
#define LACKS_UNISTD_H |
Definition at line 493 of file SDL_malloc.c.
Definition at line 2368 of file SDL_malloc.c.
Referenced by dlmalloc(), dlmallopt(), tmalloc_large(), and tmalloc_small().
Definition at line 2371 of file SDL_malloc.c.
Referenced by dlmalloc(), dlmallopt(), and tmalloc_large().
Definition at line 1886 of file SDL_malloc.c.
Referenced by tmalloc_large(), and tmalloc_small().
#define leftshift_for_tree_index | ( | i | ) |
Definition at line 2314 of file SDL_malloc.c.
Referenced by change_mparam(), and tmalloc_large().
#define M_GRANULARITY (-2) |
Definition at line 633 of file SDL_malloc.c.
Referenced by change_mparam().
#define M_MMAP_THRESHOLD (-3) |
Definition at line 634 of file SDL_malloc.c.
Referenced by change_mparam().
#define M_TRIM_THRESHOLD (-1) |
Definition at line 632 of file SDL_malloc.c.
Referenced by change_mparam().
#define MALLINFO_FIELD_TYPE size_t |
Definition at line 615 of file SDL_malloc.c.
#define MALLOC_ALIGNMENT ((size_t)8U) |
Definition at line 531 of file SDL_malloc.c.
Referenced by init_mparams(), internal_memalign(), and sys_alloc().
#define MALLOC_FAILURE_ACTION |
Definition at line 501 of file SDL_malloc.c.
Referenced by internal_memalign(), internal_realloc(), and sys_alloc().
Definition at line 2445 of file SDL_malloc.c.
Referenced by mmap_alloc(), and mmap_resize().
Definition at line 2330 of file SDL_malloc.c.
Definition at line 2334 of file SDL_malloc.c.
#define MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2) |
Definition at line 1703 of file SDL_malloc.c.
Referenced by dlmalloc(), dlmallopt(), internal_memalign(), internal_realloc(), and sys_trim().
#define MAX_SIZE_T (~(size_t)0) |
Definition at line 518 of file SDL_malloc.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 2042 of file SDL_malloc.c.
Referenced by dlmalloc(), and dlmallopt().
#define MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE) |
Definition at line 2041 of file SDL_malloc.c.
#define MCHUNK_SIZE (sizeof(mchunk)) |
Definition at line 1679 of file SDL_malloc.c.
Referenced by init_mparams().
#define mem2chunk | ( | mem | ) | ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES)) |
Definition at line 1698 of file SDL_malloc.c.
Referenced by change_mparam(), dlcalloc(), dlfree(), dlmalloc_usable_size(), dlmallopt(), dlrealloc(), ialloc(), internal_memalign(), internal_realloc(), and sys_alloc().
#define memcpy SDL_memcpy |
Definition at line 622 of file SDL_malloc.c.
Referenced by SDL_BWin::DirectConnected(), internal_realloc(), SDL_memcpy(), and SDL_tolower().
#define memset SDL_memset |
Definition at line 619 of file SDL_malloc.c.
Referenced by dlcalloc(), dlmallopt(), ialloc(), main(), and SDL_memset().
#define MFAIL ((void*)(MAX_SIZE_T)) |
Definition at line 1331 of file SDL_malloc.c.
Referenced by sys_trim(), win32direct_mmap(), and win32mmap().
#define MIN_CHUNK_SIZE ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK) |
Definition at line 1693 of file SDL_malloc.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 2040 of file SDL_malloc.c.
Referenced by change_mparam().
#define MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE) |
Definition at line 1704 of file SDL_malloc.c.
Referenced by dlmalloc(), and dlmallopt().
#define MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE)) |
Definition at line 2268 of file SDL_malloc.c.
#define minsize_for_tree_index | ( | i | ) |
Definition at line 2319 of file SDL_malloc.c.
Referenced by change_mparam().
#define MLOCK_T long |
Definition at line 1471 of file SDL_malloc.c.
#define MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES) |
Definition at line 1688 of file SDL_malloc.c.
#define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */ |
Definition at line 502 of file SDL_malloc.c.
#define MMAP_FOOT_PAD (FOUR_SIZE_T_SIZES) |
Definition at line 1690 of file SDL_malloc.c.
Referenced by change_mparam(), dlfree(), dlmallopt(), mmap_alloc(), and mmap_resize().
#define MORECORE_CONTIGUOUS 0 |
Definition at line 575 of file SDL_malloc.c.
Referenced by sys_alloc().
#define MSPACES 0 |
Definition at line 527 of file SDL_malloc.c.
#define next_chunk | ( | p | ) | ((mchunkptr)( ((char*)(p)) + ((p)->head & ~INUSE_BITS))) |
Definition at line 1745 of file SDL_malloc.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 1749 of file SDL_malloc.c.
Referenced by change_mparam().
#define NO_MALLINFO 0 |
Definition at line 612 of file SDL_malloc.c.
#define NSMALLBINS (32U) |
Definition at line 2035 of file SDL_malloc.c.
Referenced by change_mparam(), and init_bins().
#define NTREEBINS (32U) |
Definition at line 2036 of file SDL_malloc.c.
Referenced by change_mparam(), and init_bins().
Definition at line 2407 of file SDL_malloc.c.
Referenced by change_mparam(), dlfree(), dlmallopt(), internal_realloc(), tmalloc_large(), and tmalloc_small().
Definition at line 2411 of file SDL_malloc.c.
Referenced by dlfree(), dlmallopt(), and internal_realloc().
#define ok_magic | ( | M | ) | (1) |
Definition at line 2426 of file SDL_malloc.c.
Referenced by dlfree(), dlmallopt(), and dlrealloc().
Definition at line 2409 of file SDL_malloc.c.
Referenced by dlfree(), dlmallopt(), internal_realloc(), tmalloc_large(), and tmalloc_small().
Definition at line 2413 of file SDL_malloc.c.
Referenced by dlfree(), dlmallopt(), and internal_realloc().
#define ONLY_MSPACES 0 |
Definition at line 521 of file SDL_malloc.c.
#define overhead_for | ( | p | ) | (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD) |
Definition at line 1767 of file SDL_malloc.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 1707 of file SDL_malloc.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 2115 of file SDL_malloc.c.
Referenced by sys_alloc().
#define pinuse | ( | p | ) | ((p)->head & PINUSE_BIT) |
Definition at line 1734 of file SDL_malloc.c.
Referenced by change_mparam(), dlfree(), dlmallopt(), and prepend_alloc().
#define PINUSE_BIT (SIZE_T_ONE) |
Definition at line 1725 of file SDL_malloc.c.
Referenced by change_mparam(), dlfree(), dlmalloc(), dlmallopt(), init_top(), internal_realloc(), prepend_alloc(), and sys_alloc().
#define POSTACTION | ( | M | ) | { if (use_lock(M)) RELEASE_LOCK(&(M)->mutex); } |
Definition at line 2186 of file SDL_malloc.c.
Referenced by dlfree(), dlmalloc(), dlmalloc_trim(), dlmallopt(), ialloc(), internal_mallinfo(), internal_malloc_stats(), internal_memalign(), and internal_realloc().
#define PREACTION | ( | M | ) | ((GLOBALLY_INITIALIZE() || use_lock(M))? ACQUIRE_LOCK(&(M)->mutex) : 0) |
Definition at line 2185 of file SDL_malloc.c.
Referenced by dlfree(), dlmalloc(), dlmalloc_trim(), dlmallopt(), ialloc(), internal_mallinfo(), internal_malloc_stats(), internal_memalign(), and internal_realloc().
Definition at line 1746 of file SDL_malloc.c.
Referenced by change_mparam().
#define PROCEED_ON_ERROR 0 |
Definition at line 543 of file SDL_malloc.c.
#define real_calloc dlcalloc |
Definition at line 5254 of file SDL_malloc.c.
#define real_free dlfree |
Definition at line 5256 of file SDL_malloc.c.
#define real_malloc dlmalloc |
Definition at line 5253 of file SDL_malloc.c.
#define real_realloc dlrealloc |
Definition at line 5255 of file SDL_malloc.c.
#define RELEASE_LOCK | ( | l | ) | win32_release_lock(l) |
Definition at line 1495 of file SDL_malloc.c.
#define RELEASE_MAGIC_INIT_LOCK | ( | ) | RELEASE_LOCK(&magic_init_mutex); |
Definition at line 1518 of file SDL_malloc.c.
Referenced by init_mparams().
#define RELEASE_MORECORE_LOCK | ( | ) |
Definition at line 1513 of file SDL_malloc.c.
Referenced by sys_alloc(), and sys_trim().
#define replace_dv | ( | M, | |
P, | |||
S | |||
) |
Definition at line 3031 of file SDL_malloc.c.
Referenced by dlmalloc(), dlmallopt(), and tmalloc_small().
#define request2size | ( | req | ) | (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req)) |
Definition at line 1711 of file SDL_malloc.c.
Referenced by ialloc(), internal_memalign(), and internal_realloc().
Definition at line 2435 of file SDL_malloc.c.
Referenced by dlfree(), dlmallopt(), internal_realloc(), tmalloc_large(), and tmalloc_small().
Definition at line 2374 of file SDL_malloc.c.
#define segment_holds | ( | S, | |
A | |||
) | ((char*)(A) >= S->base && (char*)(A) < S->base + S->size) |
Definition at line 2128 of file SDL_malloc.c.
Referenced by change_mparam(), internal_mallinfo(), internal_malloc_stats(), release_unused_segments(), and sys_alloc().
Definition at line 1753 of file SDL_malloc.c.
#define set_free_with_pinuse | ( | p, | |
s, | |||
n | |||
) | (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s)) |
Definition at line 1760 of file SDL_malloc.c.
Referenced by add_segment(), dlfree(), dlmallopt(), and prepend_alloc().
Definition at line 2448 of file SDL_malloc.c.
Referenced by internal_memalign(), and internal_realloc().
Definition at line 2453 of file SDL_malloc.c.
Referenced by dlmalloc(), dlmallopt(), tmalloc_large(), and tmalloc_small().
#define set_lock | ( | M, | |
L | |||
) |
Definition at line 2109 of file SDL_malloc.c.
Referenced by dlmallopt().
Definition at line 1756 of file SDL_malloc.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 2458 of file SDL_malloc.c.
Referenced by add_segment(), dlmalloc(), dlmallopt(), ialloc(), prepend_alloc(), sys_alloc(), tmalloc_large(), and tmalloc_small().
Definition at line 2158 of file SDL_malloc.c.
Referenced by dlfree(), and dlmallopt().
#define SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES) |
Definition at line 1307 of file SDL_malloc.c.
Referenced by mmap_alloc(), and mmap_resize().
#define SIZE_T_BITSIZE (sizeof(size_t) << 3) |
Definition at line 1298 of file SDL_malloc.c.
Referenced by change_mparam(), and tmalloc_large().
#define SIZE_T_ONE ((size_t)1) |
Definition at line 1303 of file SDL_malloc.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 1297 of file SDL_malloc.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 1304 of file SDL_malloc.c.
#define SIZE_T_ZERO ((size_t)0) |
Definition at line 1302 of file SDL_malloc.c.
#define small_index | ( | s | ) | ((s) >> SMALLBIN_SHIFT) |
Definition at line 2266 of file SDL_malloc.c.
Referenced by change_mparam(), dlmalloc(), and dlmallopt().
#define small_index2size | ( | i | ) | ((i) << SMALLBIN_SHIFT) |
Definition at line 2267 of file SDL_malloc.c.
Referenced by dlmalloc(), and dlmallopt().
Definition at line 2271 of file SDL_malloc.c.
Referenced by change_mparam(), dlmalloc(), dlmallopt(), and init_bins().
#define SMALLBIN_SHIFT (3U) |
Definition at line 2037 of file SDL_malloc.c.
#define SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT) |
Definition at line 2038 of file SDL_malloc.c.
Definition at line 2332 of file SDL_malloc.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 2168 of file SDL_malloc.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 2272 of file SDL_malloc.c.
Referenced by change_mparam(), init_bins(), tmalloc_large(), and tmalloc_small().
#define TREEBIN_SHIFT (8U) |
Definition at line 2039 of file SDL_malloc.c.
Definition at line 2336 of file SDL_malloc.c.
Referenced by change_mparam().
#define TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1) |
Definition at line 1305 of file SDL_malloc.c.
#define unlink_chunk | ( | M, | |
P, | |||
S | |||
) |
Definition at line 3190 of file SDL_malloc.c.
Referenced by dlfree(), dlmallopt(), and prepend_alloc().
#define unlink_first_small_chunk | ( | M, | |
B, | |||
P, | |||
I | |||
) |
Definition at line 3013 of file SDL_malloc.c.
Referenced by dlmalloc(), and dlmallopt().
#define unlink_large_chunk | ( | M, | |
X | |||
) |
Definition at line 3113 of file SDL_malloc.c.
Referenced by release_unused_segments(), tmalloc_large(), and tmalloc_small().
#define unlink_small_chunk | ( | M, | |
P, | |||
S | |||
) |
Definition at line 2993 of file SDL_malloc.c.
Definition at line 2225 of file SDL_malloc.c.
Referenced by dlfree(), dlmallopt(), dlrealloc(), and internal_realloc().
#define USE_BUILTIN_FFS 0 |
Definition at line 606 of file SDL_malloc.c.
#define USE_DEV_RANDOM 0 |
Definition at line 609 of file SDL_malloc.c.
#define USE_DL_PREFIX |
Definition at line 41 of file SDL_malloc.c.
#define use_lock | ( | M | ) | ((M)->mflags & USE_LOCK_BIT) |
Definition at line 2098 of file SDL_malloc.c.
#define USE_LOCK_BIT (2U) |
Definition at line 1502 of file SDL_malloc.c.
Referenced by init_mparams().
#define USE_LOCKS 1 |
Definition at line 40 of file SDL_malloc.c.
#define use_mmap | ( | M | ) | ((M)->mflags & USE_MMAP_BIT) |
Definition at line 2102 of file SDL_malloc.c.
Referenced by change_mparam(), ialloc(), and sys_alloc().
#define USE_MMAP_BIT (SIZE_T_ONE) |
Definition at line 1343 of file SDL_malloc.c.
Referenced by init_mparams().
#define use_noncontiguous | ( | M | ) | ((M)->mflags & USE_NONCONTIGUOUS_BIT) |
Definition at line 2106 of file SDL_malloc.c.
Referenced by sys_alloc().
#define USE_NONCONTIGUOUS_BIT (4U) |
Definition at line 1427 of file SDL_malloc.c.
Referenced by init_mparams().
#define WIN32 1 |
Definition at line 485 of file SDL_malloc.c.
#define WIN32_LEAN_AND_MEAN |
Definition at line 489 of file SDL_malloc.c.
Definition at line 1673 of file SDL_malloc.c.
typedef unsigned int binmap_t |
Definition at line 1674 of file SDL_malloc.c.
typedef unsigned int flag_t |
Definition at line 1675 of file SDL_malloc.c.
Definition at line 3387 of file SDL_malloc.c.
References align_offset, assert, check_top_chunk, chunk2mem, CHUNK_ALIGN_MASK, chunk_plus_offset, FENCEPOST_HEAD, FOUR_SIZE_T_SIZES, init_top(), insert_chunk, is_aligned, MIN_CHUNK_SIZE, pad_request, segment_holding(), set_free_with_pinuse, set_size_and_pinuse_of_inuse_chunk, SIZE_T_SIZE, and TOP_FOOT_SIZE.
Referenced by sys_alloc().
|
static |
Definition at line 2569 of file SDL_malloc.c.
References align_as_chunk, assert, sbinptr::bk, chunk2mem, CHUNK_ALIGN_MASK, chunk_plus_offset, chunksize, cinuse, CINUSE_BIT, compute_tree_index, FENCEPOST_HEAD, mstate::footprint, malloc_params::granularity, head, i, init_mparams(), is_aligned, is_initialized, is_mmapped, IS_MMAPPED_BIT, is_small, leftshift_for_tree_index, M_GRANULARITY, M_MMAP_THRESHOLD, M_TRIM_THRESHOLD, mem2chunk, MIN_CHUNK_SIZE, MIN_LARGE_SIZE, minsize_for_tree_index, MMAP_FOOT_PAD, malloc_params::mmap_threshold, mparams, next_chunk, next_pinuse, NSMALLBINS, NTREEBINS, ok_address, malloc_params::page_size, pinuse, PINUSE_BIT, prev_chunk, segment_holding(), segment_holds, SIZE_T_BITSIZE, SIZE_T_ONE, SIZE_T_SIZE, small_index, smallbin_at, smallmap_is_marked, TOP_FOOT_SIZE, treebin_at, treemap_is_marked, malloc_params::trim_threshold, and use_mmap.
Referenced by dlmallopt().
Definition at line 4385 of file SDL_malloc.c.
References calloc_must_clear, dlmalloc(), MAX_SIZE_T, mem2chunk, and memset.
Definition at line 4288 of file SDL_malloc.c.
References CALL_MUNMAP, check_free_chunk, check_inuse_chunk, chunk_minus_offset, chunk_plus_offset, chunksize, cinuse, fm, 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, RTCHECK, set_free_with_pinuse, set_size_and_pinuse_of_free_chunk, should_trim, sys_trim(), unlink_chunk, and USAGE_ERROR_ACTION.
Referenced by dlrealloc().
Definition at line 4433 of file SDL_malloc.c.
Definition at line 4440 of file SDL_malloc.c.
Definition at line 4154 of file SDL_malloc.c.
References assert, check_malloced_chunk, check_top_chunk, chunk2mem, chunk_plus_offset, chunksize, compute_bit2idx, gm, i, 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.
Referenced by dlcalloc(), and dlrealloc().
Definition at line 4476 of file SDL_malloc.c.
References gm.
Definition at line 4482 of file SDL_malloc.c.
References gm.
int dlmalloc_trim | ( | size_t | pad | ) |
Definition at line 4502 of file SDL_malloc.c.
References chunksize, cinuse, mem2chunk, and overhead_for.
int dlmallopt | ( | int | param_number, |
int | value | ||
) |
Definition at line 4513 of file SDL_malloc.c.
References align_as_chunk, assert, msegmentptr::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, EXTERN_BIT, fm, mstate::footprint, malloc_params::granularity, granularity_align, i, 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, least_bit, left_bits, malloc_params::magic, mstate::max_footprint, MAX_REQUEST, MAX_SIZE_T, MAX_SMALL_REQUEST, mem2chunk, memset, MIN_CHUNK_SIZE, MIN_REQUEST, MMAP_FOOT_PAD, mparams, next_chunk, ok_address, ok_cinuse, ok_magic, ok_next, ok_pinuse, pad_request, malloc_params::page_size, pinuse, PINUSE_BIT, POSTACTION, PREACTION, replace_dv, RTCHECK, set_free_with_pinuse, set_inuse_and_pinuse, set_lock, set_size_and_pinuse_of_free_chunk, set_size_and_pinuse_of_inuse_chunk, should_trim, SIZE_T_SIZE, small_index, small_index2size, smallbin_at, sys_alloc(), sys_trim(), tmalloc_large(), tmalloc_small(), TOP_FOOT_SIZE, unlink_chunk, unlink_first_small_chunk, and USAGE_ERROR_ACTION.
Definition at line 4427 of file SDL_malloc.c.
References gm, and internal_memalign().
Referenced by dlpvalloc(), and dlvalloc().
Definition at line 4455 of file SDL_malloc.c.
References dlmemalign(), init_mparams(), mparams, malloc_params::page_size, and SIZE_T_ONE.
Definition at line 4402 of file SDL_malloc.c.
References dlfree(), dlmalloc(), gm, internal_realloc(), mem2chunk, ok_magic, and USAGE_ERROR_ACTION.
Definition at line 4446 of file SDL_malloc.c.
References dlmemalign(), init_mparams(), mparams, and malloc_params::page_size.
|
static |
|
static |
Definition at line 4028 of file SDL_malloc.c.
References assert, check_inuse_chunk, chunk2mem, CHUNK_OVERHEAD, chunk_plus_offset, chunksize, disable_mmap, enable_mmap, i, internal_malloc, is_mmapped, mem2chunk, memset, POSTACTION, PREACTION, request2size, set_size_and_pinuse_of_inuse_chunk, SIZE_T_SIZE, and use_mmap.
Referenced by dlindependent_calloc(), dlindependent_comalloc(), and dlmallopt().
|
static |
Definition at line 3312 of file SDL_malloc.c.
References i, NSMALLBINS, NTREEBINS, smallbin_at, and treebin_at.
Referenced by dlmallopt(), and sys_alloc().
|
static |
Definition at line 2491 of file SDL_malloc.c.
References ABORT, ACQUIRE_MAGIC_INIT_LOCK, DEFAULT_GRANULARITY, malloc_params::default_mflags, DEFAULT_MMAP_THRESHOLD, DEFAULT_TRIM_THRESHOLD, gm, malloc_params::granularity, INITIAL_LOCK, malloc_params::magic, MALLOC_ALIGNMENT, 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 3295 of file SDL_malloc.c.
References align_offset, chunk2mem, chunk_plus_offset, mparams, PINUSE_BIT, TOP_FOOT_SIZE, and malloc_params::trim_threshold.
Referenced by add_segment(), dlmallopt(), sys_alloc(), and sys_trim().
|
static |
Definition at line 2884 of file SDL_malloc.c.
References align_as_chunk, mallinfo::arena, check_malloc_state, chunksize, cinuse, FENCEPOST_HEAD, mallinfo::fordblks, mallinfo::hblkhd, is_initialized, mallinfo::keepcost, next_chunk, mallinfo::ordblks, POSTACTION, PREACTION, segment_holds, SIZE_T_ONE, TOP_FOOT_SIZE, mallinfo::uordblks, and mallinfo::usmblks.
Referenced by dlmallinfo(), and dlmallopt().
|
static |
Definition at line 2925 of file SDL_malloc.c.
References align_as_chunk, check_malloc_state, chunksize, cinuse, FENCEPOST_HEAD, is_initialized, next_chunk, POSTACTION, PREACTION, segment_holds, and TOP_FOOT_SIZE.
Referenced by dlmalloc_stats(), and dlmallopt().
Definition at line 3938 of file SDL_malloc.c.
References assert, check_inuse_chunk, chunk2mem, CHUNK_OVERHEAD, chunk_plus_offset, chunksize, CINUSE_BIT, internal_free, internal_malloc, is_mmapped, MALLOC_ALIGNMENT, MALLOC_FAILURE_ACTION, MAX_REQUEST, mem2chunk, MIN_CHUNK_SIZE, POSTACTION, PREACTION, request2size, set_inuse, and SIZE_T_ONE.
Referenced by dlmallopt(), and dlmemalign().
Definition at line 3868 of file SDL_malloc.c.
References check_inuse_chunk, chunk2mem, chunk_plus_offset, chunksize, 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, and USAGE_ERROR_ACTION.
Referenced by dlmallopt(), and dlrealloc().
Definition at line 3226 of file SDL_malloc.c.
References align_offset, assert, check_mmapped_chunk, chunk2mem, CHUNK_ALIGN_MASK, chunk_plus_offset, CINUSE_BIT, CMFAIL, DIRECT_MMAP, FENCEPOST_HEAD, granularity_align, head, is_aligned, IS_MMAPPED_BIT, mark_inuse_foot, MMAP_FOOT_PAD, sbinptr::prev_foot, SIX_SIZE_T_SIZES, and SIZE_T_SIZE.
Referenced by sys_alloc().
|
static |
Definition at line 3256 of file SDL_malloc.c.
References CALL_MREMAP, check_mmapped_chunk, CHUNK_ALIGN_MASK, chunk_plus_offset, chunksize, CINUSE_BIT, CMFAIL, cp, FENCEPOST_HEAD, malloc_params::granularity, granularity_align, IS_MMAPPED_BIT, is_small, mark_inuse_foot, MMAP_FOOT_PAD, mparams, SIX_SIZE_T_SIZES, and SIZE_T_SIZE.
Referenced by internal_realloc().
Definition at line 3345 of file SDL_malloc.c.
References align_as_chunk, assert, check_free_chunk, check_malloced_chunk, check_top_chunk, chunk2mem, chunk_plus_offset, chunksize, cinuse, 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, and unlink_chunk.
Referenced by sys_alloc().
|
static |
Definition at line 3644 of file SDL_malloc.c.
References align_as_chunk, assert, msegmentptr::base, CALL_MUNMAP, chunksize, cinuse, insert_large_chunk, is_extern_segment, is_mmapped_segment, msegmentptr::next, segment_holds, TOP_FOOT_SIZE, and unlink_large_chunk.
Referenced by sys_trim().
Definition at line 5335 of file SDL_malloc.c.
References s_mem, and SDL_AtomicIncRef.
Definition at line 5366 of file SDL_malloc.c.
References s_mem, SDL_AtomicDecRef, and void.
void SDL_GetMemoryFunctions | ( | SDL_malloc_func * | malloc_func, |
SDL_calloc_func * | calloc_func, | ||
SDL_realloc_func * | realloc_func, | ||
SDL_free_func * | free_func | ||
) |
Get the current set of SDL memory functions.
Definition at line 5271 of file SDL_malloc.c.
References s_mem.
int SDL_GetNumAllocations | ( | void | ) |
Get the number of outstanding (unfreed) allocations.
Definition at line 5315 of file SDL_malloc.c.
References s_mem, and SDL_AtomicGet.
Definition at line 5320 of file SDL_malloc.c.
References s_mem, and SDL_AtomicIncRef.
Definition at line 5351 of file SDL_malloc.c.
References s_mem, and SDL_AtomicIncRef.
int SDL_SetMemoryFunctions | ( | SDL_malloc_func | malloc_func, |
SDL_calloc_func | calloc_func, | ||
SDL_realloc_func | realloc_func, | ||
SDL_free_func | free_func | ||
) |
Replace SDL's memory allocation functions with a custom set.
Definition at line 5290 of file SDL_malloc.c.
References calloc_func, free_func, malloc_func, realloc_func, s_mem, and SDL_InvalidParamError.
|
static |
Definition at line 2133 of file SDL_malloc.c.
Referenced by add_segment(), change_mparam(), sys_alloc(), and sys_trim().
Definition at line 3444 of file SDL_malloc.c.
References ACQUIRE_MORECORE_LOCK, add_segment(), CALL_MMAP, CALL_MORECORE, check_malloced_chunk, check_top_chunk, chunk2mem, chunk_plus_offset, CMFAIL, disable_contiguous, granularity_align, HALF_MAX_SIZE_T, HAVE_MMAP, HAVE_MORECORE, init_bins(), init_mparams(), init_top(), is_extern_segment, is_global, is_initialized, IS_MMAPPED_BIT, is_page_aligned, malloc_params::magic, MALLOC_ALIGNMENT, MALLOC_FAILURE_ACTION, mem2chunk, mmap_alloc(), malloc_params::mmap_threshold, MORECORE_CONTIGUOUS, mparams, msegmentptr::next, next_chunk, page_align, PINUSE_BIT, prepend_alloc(), RELEASE_MORECORE_LOCK, segment_holding(), segment_holds, set_size_and_pinuse_of_inuse_chunk, msegmentptr::size, SIZE_T_ONE, TOP_FOOT_SIZE, use_mmap, and use_noncontiguous.
Referenced by dlmalloc(), and dlmallopt().
|
static |
Definition at line 3685 of file SDL_malloc.c.
References ACQUIRE_MORECORE_LOCK, CALL_MORECORE, CALL_MREMAP, CALL_MUNMAP, check_top_chunk, CMFAIL, 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(), SIZE_T_ONE, and TOP_FOOT_SIZE.
Referenced by dlfree(), dlmalloc_trim(), and dlmallopt().
Definition at line 3751 of file SDL_malloc.c.
References assert, chunk2mem, chunk_plus_offset, chunksize, compute_bit2idx, compute_tree_index, CORRUPTION_ERROR_ACTION, i, 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, and unlink_large_chunk.
Referenced by dlmalloc(), and dlmallopt().
Definition at line 3826 of file SDL_malloc.c.
References assert, chunk2mem, chunk_plus_offset, chunksize, compute_bit2idx, CORRUPTION_ERROR_ACTION, i, 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, and unlink_large_chunk.
Referenced by dlmalloc(), and dlmallopt().
|
static |
Definition at line 1473 of file SDL_malloc.c.
Definition at line 1488 of file SDL_malloc.c.
Definition at line 1390 of file SDL_malloc.c.
|
static |
Definition at line 2089 of file SDL_malloc.c.
SDL_calloc_func calloc_func |
Definition at line 5263 of file SDL_malloc.c.
Referenced by SDL_SetMemoryFunctions().
SDL_free_func free_func |
Definition at line 5265 of file SDL_malloc.c.
Referenced by SDL_SetMemoryFunctions().
|
static |
Definition at line 1499 of file SDL_malloc.c.
SDL_malloc_func malloc_func |
Definition at line 5262 of file SDL_malloc.c.
Referenced by SDL_SetMemoryFunctions().
|
static |
Definition at line 2086 of file SDL_malloc.c.
Referenced by change_mparam(), dlmallopt(), dlpvalloc(), dlvalloc(), init_mparams(), init_top(), mmap_resize(), sys_alloc(), and sys_trim().
SDL_atomic_t num_allocations |
Definition at line 5266 of file SDL_malloc.c.
SDL_realloc_func realloc_func |
Definition at line 5264 of file SDL_malloc.c.
Referenced by SDL_SetMemoryFunctions().
struct { ... } s_mem |
Referenced by SDL_calloc(), SDL_free(), SDL_GetMemoryFunctions(), SDL_GetNumAllocations(), SDL_malloc(), SDL_realloc(), and SDL_SetMemoryFunctions().