-
912typedef enum mi_option_e {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
911typedef enum mi_option_e {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
978void*
mi_recalloc(
void* p,
size_t count,
size_t size);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
993int mi_wdupenv_s(
unsigned short** buf,
size_t* size,
const unsigned short* name);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
1028void*
mi_new_n(
size_t count,
size_t size)
noexcept(
false);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
977void*
mi_recalloc(
void* p,
size_t count,
size_t size);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
992int mi_wdupenv_s(
unsigned short** buf,
size_t* size,
const unsigned short* name);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
1027void*
mi_new_n(
size_t count,
size_t size)
noexcept(
false);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
void * mi_malloc_aligned_at(size_t size, size_t alignment, size_t offset)
Allocate size bytes aligned by alignment at a specified offset.
void * mi_calloc_aligned(size_t count, size_t size, size_t alignment)
void * mi_realloc_aligned(void *p, size_t newsize, size_t alignment)
@@ -483,20 +483,20 @@ $(function(){initNavTree('mimalloc-doc_8h_source.html',''); initResizable(true);
void * mi_calloc_aligned_at(size_t count, size_t size, size_t alignment, size_t offset)
void * mi_zalloc_aligned(size_t size, size_t alignment)
void * mi_realloc_aligned_at(void *p, size_t newsize, size_t alignment, size_t offset)
-
int heap_tag
heap tag associated with this area (see mi_heap_new_ex)
Definition mimalloc-doc.h:861
-
size_t block_size
size in bytes of one block
Definition mimalloc-doc.h:859
-
size_t committed
current committed bytes of this area
Definition mimalloc-doc.h:857
-
size_t full_block_size
size in bytes of a full block including padding and metadata.
Definition mimalloc-doc.h:860
-
size_t used
bytes in use by allocated blocks
Definition mimalloc-doc.h:858
-
void * blocks
start of the area containing heap blocks
Definition mimalloc-doc.h:855
-
size_t reserved
bytes reserved for this area
Definition mimalloc-doc.h:856
+
int heap_tag
heap tag associated with this area (see mi_heap_new_ex)
Definition mimalloc-doc.h:860
+
size_t block_size
size in bytes of one block
Definition mimalloc-doc.h:858
+
size_t committed
current committed bytes of this area
Definition mimalloc-doc.h:856
+
size_t full_block_size
size in bytes of a full block including padding and metadata.
Definition mimalloc-doc.h:859
+
size_t used
bytes in use by allocated blocks
Definition mimalloc-doc.h:857
+
void * blocks
start of the area containing heap blocks
Definition mimalloc-doc.h:854
+
size_t reserved
bytes reserved for this area
Definition mimalloc-doc.h:855
bool mi_heap_check_owned(mi_heap_t *heap, const void *p)
Check safely if any pointer is part of a heap.
bool mi_check_owned(const void *p)
Check safely if any pointer is part of the default heap of this thread.
bool mi_abandoned_visit_blocks(mi_subproc_id_t subproc_id, int heap_tag, bool visit_blocks, mi_block_visit_fun *visitor, void *arg)
Visit all areas and blocks in abandoned heaps.
bool mi_heap_visit_blocks(const mi_heap_t *heap, bool visit_all_blocks, mi_block_visit_fun *visitor, void *arg)
Visit all areas and blocks in a heap.
-
bool mi_block_visit_fun(const mi_heap_t *heap, const mi_heap_area_t *area, void *block, size_t block_size, void *arg)
Visitor function passed to mi_heap_visit_blocks()
Definition mimalloc-doc.h:871
+
bool mi_block_visit_fun(const mi_heap_t *heap, const mi_heap_area_t *area, void *block, size_t block_size, void *arg)
Visitor function passed to mi_heap_visit_blocks()
Definition mimalloc-doc.h:870
bool mi_heap_contains_block(mi_heap_t *heap, const void *p)
Does a heap contain a pointer to a previously allocated block?
-
An area of heap space contains blocks of a single size.
Definition mimalloc-doc.h:854
+
An area of heap space contains blocks of a single size.
Definition mimalloc-doc.h:853
void * mi_new_nothrow(size_t n)
like mi_malloc, but when out of memory, use std::get_new_handler but return NULL on failure.
void * mi_new(std::size_t n) noexcept(false)
like mi_malloc(), but when out of memory, use std::get_new_handler and raise std::bad_alloc exception...
void * mi_new_realloc(void *p, size_t newsize)
like mi_realloc(), but when out of memory, use std::get_new_handler and raise std::bad_alloc exceptio...
@@ -504,7 +504,7 @@ $(function(){initNavTree('mimalloc-doc_8h_source.html',''); initResizable(true);
void * mi_new_aligned_nothrow(size_t n, size_t alignment)
like mi_malloc_aligned, but when out of memory, use std::get_new_handler but return NULL on failure.
void * mi_new_reallocn(void *p, size_t newcount, size_t size)
like mi_reallocn(), but when out of memory, use std::get_new_handler and raise std::bad_alloc excepti...
void * mi_new_n(size_t count, size_t size) noexcept(false)
like mi_mallocn(), but when out of memory, use std::get_new_handler and raise std::bad_alloc exceptio...
-
std::allocator implementation for mimalloc for use in STL containers.
Definition mimalloc-doc.h:1052
+
std::allocator implementation for mimalloc for use in STL containers.
Definition mimalloc-doc.h:1051
int mi_reserve_os_memory(size_t size, bool commit, bool allow_large)
Reserve OS memory for use by mimalloc.
size_t mi_usable_size(void *p)
Return the available bytes in a memory block.
void mi_thread_done(void)
Uninitialize mimalloc on a thread.
@@ -529,7 +529,7 @@ $(function(){initNavTree('mimalloc-doc_8h_source.html',''); initResizable(true);
mi_subproc_id_t mi_subproc_new(void)
Create a fresh sub-process (with no associated threads yet).
void mi_error_fun(int err, void *arg)
Type of error callback functions.
Definition mimalloc-doc.h:393
void mi_stats_merge(void)
Merge thread local statistics with the main statistics and reset.
-
void * mi_subproc_id_t
A process can associate threads with sub-processes.
Definition mimalloc-doc.h:558
+
void * mi_subproc_id_t
A process can associate threads with sub-processes.
Definition mimalloc-doc.h:557
int mi_arena_id_t
Mimalloc uses large (virtual) memory areas, called "arena"s, from the OS to manage its memory.
Definition mimalloc-doc.h:499
void * mi_arena_area(mi_arena_id_t arena_id, size_t *size)
Return the size of an arena.
void mi_register_error(mi_error_fun *errfun, void *arg)
Register an error callback function.
@@ -548,7 +548,7 @@ $(function(){initNavTree('mimalloc-doc_8h_source.html',''); initResizable(true);
void mi_heap_delete(mi_heap_t *heap)
Delete a previously allocated heap.
void * mi_heap_malloc_aligned(mi_heap_t *heap, size_t size, size_t alignment)
mi_heap_t * mi_heap_set_default(mi_heap_t *heap)
Set the default heap to use in the current thread for mi_malloc() et al.
-
struct mi_heap_s mi_heap_t
Type of first-class heaps.
Definition mimalloc-doc.h:647
+
struct mi_heap_s mi_heap_t
Type of first-class heaps.
Definition mimalloc-doc.h:646
void * mi_heap_zalloc_aligned_at(mi_heap_t *heap, size_t size, size_t alignment, size_t offset)
char * mi_heap_realpath(mi_heap_t *heap, const char *fname, char *resolved_name)
Resolve a file path name using a specific heap to allocate the result.
char * mi_heap_strdup(mi_heap_t *heap, const char *s)
Duplicate a string in a specific heap.
@@ -593,36 +593,36 @@ $(function(){initNavTree('mimalloc-doc_8h_source.html',''); initResizable(true);
void mi_option_set_enabled(mi_option_t option, bool enable)
void mi_option_disable(mi_option_t option)
void mi_option_set(mi_option_t option, long value)
-
mi_option_t
Runtime options.
Definition mimalloc-doc.h:912
-
@ mi_option_abandoned_reclaim_on_free
allow to reclaim an abandoned segment on a free (=1)
Definition mimalloc-doc.h:942
-
@ mi_option_purge_extend_delay
extend purge delay on each subsequent delay (=1)
Definition mimalloc-doc.h:943
-
@ mi_option_show_stats
Print statistics on termination.
Definition mimalloc-doc.h:915
-
@ mi_option_use_numa_nodes
0 = use all available numa nodes, otherwise use at most N nodes.
Definition mimalloc-doc.h:936
-
@ mi_option_abandoned_page_purge
immediately purge delayed purges on thread termination
Definition mimalloc-doc.h:934
-
@ mi_option_eager_commit_delay
the first N segments per thread are not eagerly committed (but per page in the segment on demand)
Definition mimalloc-doc.h:932
-
@ mi_option_eager_commit
eager commit segments? (after eager_commit_delay segments) (enabled by default).
Definition mimalloc-doc.h:931
-
@ mi_option_visit_abandoned
allow visiting heap blocks from abandoned threads (=0)
Definition mimalloc-doc.h:945
-
@ mi_option_os_tag
tag used for OS logging (macOS only for now) (=100)
Definition mimalloc-doc.h:927
-
@ _mi_option_last
Definition mimalloc-doc.h:947
-
@ mi_option_destroy_on_exit
if set, release all memory on exit; sometimes used for dynamic unloading but can be unsafe
Definition mimalloc-doc.h:940
-
@ mi_option_verbose
Print verbose messages.
Definition mimalloc-doc.h:916
-
@ mi_option_allow_large_os_pages
allow large (2 or 4 MiB) OS pages, implies eager commit. If false, also disables THP for the process.
Definition mimalloc-doc.h:924
-
@ mi_option_arena_purge_mult
multiplier for purge_delay for the purging delay for arenas (=10)
Definition mimalloc-doc.h:941
-
@ mi_option_retry_on_oom
retry on out-of-memory for N milli seconds (=400), set to 0 to disable retries. (only on windows)
Definition mimalloc-doc.h:928
-
@ mi_option_purge_decommits
should a memory purge decommit? (=1). Set to 0 to use memory reset on a purge (instead of decommit)
Definition mimalloc-doc.h:925
-
@ mi_option_limit_os_alloc
If set to 1, do not use OS memory for allocation (but only pre-reserved arenas)
Definition mimalloc-doc.h:938
-
@ mi_option_reserve_huge_os_pages_at
Reserve N huge OS pages at a specific NUMA node N.
Definition mimalloc-doc.h:922
-
@ mi_option_max_segment_reclaim
max. percentage of the abandoned segments can be reclaimed per try (=10%)
Definition mimalloc-doc.h:939
-
@ mi_option_arena_reserve
initial memory size for arena reservation (= 1 GiB on 64-bit) (internally, this value is in KiB; use ...
Definition mimalloc-doc.h:926
-
@ mi_option_reserve_huge_os_pages
reserve N huge OS pages (1GiB pages) at startup
Definition mimalloc-doc.h:921
-
@ mi_option_disallow_os_alloc
1 = do not use OS memory for allocation (but only programmatically reserved arenas)
Definition mimalloc-doc.h:937
-
@ mi_option_purge_delay
memory purging is delayed by N milli seconds; use 0 for immediate purging or -1 for no purging at all...
Definition mimalloc-doc.h:935
-
@ mi_option_disallow_arena_alloc
1 = do not use arena's for allocation (except if using specific arena id's)
Definition mimalloc-doc.h:944
-
@ mi_option_max_errors
issue at most N error messages
Definition mimalloc-doc.h:917
-
@ mi_option_max_warnings
issue at most N warning messages
Definition mimalloc-doc.h:918
-
@ mi_option_show_errors
Print error messages.
Definition mimalloc-doc.h:914
-
@ mi_option_reserve_os_memory
reserve specified amount of OS memory in an arena at startup (internally, this value is in KiB; use m...
Definition mimalloc-doc.h:923
-
@ mi_option_arena_eager_commit
eager commit arenas? Use 2 to enable just on overcommit systems (=2)
Definition mimalloc-doc.h:933
+
mi_option_t
Runtime options.
Definition mimalloc-doc.h:911
+
@ mi_option_abandoned_reclaim_on_free
allow to reclaim an abandoned segment on a free (=1)
Definition mimalloc-doc.h:941
+
@ mi_option_purge_extend_delay
extend purge delay on each subsequent delay (=1)
Definition mimalloc-doc.h:942
+
@ mi_option_show_stats
Print statistics on termination.
Definition mimalloc-doc.h:914
+
@ mi_option_use_numa_nodes
0 = use all available numa nodes, otherwise use at most N nodes.
Definition mimalloc-doc.h:935
+
@ mi_option_abandoned_page_purge
immediately purge delayed purges on thread termination
Definition mimalloc-doc.h:933
+
@ mi_option_eager_commit_delay
the first N segments per thread are not eagerly committed (but per page in the segment on demand)
Definition mimalloc-doc.h:931
+
@ mi_option_eager_commit
eager commit segments? (after eager_commit_delay segments) (enabled by default).
Definition mimalloc-doc.h:930
+
@ mi_option_visit_abandoned
allow visiting heap blocks from abandoned threads (=0)
Definition mimalloc-doc.h:944
+
@ mi_option_os_tag
tag used for OS logging (macOS only for now) (=100)
Definition mimalloc-doc.h:926
+
@ _mi_option_last
Definition mimalloc-doc.h:946
+
@ mi_option_destroy_on_exit
if set, release all memory on exit; sometimes used for dynamic unloading but can be unsafe
Definition mimalloc-doc.h:939
+
@ mi_option_verbose
Print verbose messages.
Definition mimalloc-doc.h:915
+
@ mi_option_allow_large_os_pages
allow large (2 or 4 MiB) OS pages, implies eager commit. If false, also disables THP for the process.
Definition mimalloc-doc.h:923
+
@ mi_option_arena_purge_mult
multiplier for purge_delay for the purging delay for arenas (=10)
Definition mimalloc-doc.h:940
+
@ mi_option_retry_on_oom
retry on out-of-memory for N milli seconds (=400), set to 0 to disable retries. (only on windows)
Definition mimalloc-doc.h:927
+
@ mi_option_purge_decommits
should a memory purge decommit? (=1). Set to 0 to use memory reset on a purge (instead of decommit)
Definition mimalloc-doc.h:924
+
@ mi_option_limit_os_alloc
If set to 1, do not use OS memory for allocation (but only pre-reserved arenas)
Definition mimalloc-doc.h:937
+
@ mi_option_reserve_huge_os_pages_at
Reserve N huge OS pages at a specific NUMA node N.
Definition mimalloc-doc.h:921
+
@ mi_option_max_segment_reclaim
max. percentage of the abandoned segments can be reclaimed per try (=10%)
Definition mimalloc-doc.h:938
+
@ mi_option_arena_reserve
initial memory size for arena reservation (= 1 GiB on 64-bit) (internally, this value is in KiB; use ...
Definition mimalloc-doc.h:925
+
@ mi_option_reserve_huge_os_pages
reserve N huge OS pages (1GiB pages) at startup
Definition mimalloc-doc.h:920
+
@ mi_option_disallow_os_alloc
1 = do not use OS memory for allocation (but only programmatically reserved arenas)
Definition mimalloc-doc.h:936
+
@ mi_option_purge_delay
memory purging is delayed by N milli seconds; use 0 for immediate purging or -1 for no purging at all...
Definition mimalloc-doc.h:934
+
@ mi_option_disallow_arena_alloc
1 = do not use arena's for allocation (except if using specific arena id's)
Definition mimalloc-doc.h:943
+
@ mi_option_max_errors
issue at most N error messages
Definition mimalloc-doc.h:916
+
@ mi_option_max_warnings
issue at most N warning messages
Definition mimalloc-doc.h:917
+
@ mi_option_show_errors
Print error messages.
Definition mimalloc-doc.h:913
+
@ mi_option_reserve_os_memory
reserve specified amount of OS memory in an arena at startup (internally, this value is in KiB; use m...
Definition mimalloc-doc.h:922
+
@ mi_option_arena_eager_commit
eager commit arenas? Use 2 to enable just on overcommit systems (=2)
Definition mimalloc-doc.h:932
size_t mi_malloc_usable_size(const void *p)
void mi_free_aligned(void *p, size_t alignment)
void * mi_aligned_offset_recalloc(void *p, size_t newcount, size_t size, size_t alignment, size_t offset)