<divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">/* ----------------------------------------------------------------------------</span></div><divclass="line"><aname="l00002"></a><spanclass="lineno"> 2</span> <spanclass="comment">Copyright (c) 2018, Microsoft Research, Daan Leijen</span></div><divclass="line"><aname="l00003"></a><spanclass="lineno"> 3</span> <spanclass="comment">This is free software; you can redistribute it and/or modify it under the</span></div><divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment">terms of the MIT license. A copy of the license can be found in the file</span></div><divclass="line"><aname="l00005"></a><spanclass="lineno"> 5</span> <spanclass="comment">"LICENSE" at the root of this distribution.</span></div><divclass="line"><aname="l00006"></a><spanclass="lineno"> 6</span> <spanclass="comment">-----------------------------------------------------------------------------*/</span></div><divclass="line"><aname="l00007"></a><spanclass="lineno"> 7</span> </div><divclass="line"><aname="l00008"></a><spanclass="lineno"> 8</span> <spanclass="preprocessor">#error "documentation file only!"</span></div><divclass="line"><aname="l00009"></a><spanclass="lineno"> 9</span> </div><divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> </div><divclass="line"><aname="l00078"></a><spanclass="lineno"> 78</span> </div><divclass="line"><aname="l00082"></a><spanclass="lineno"> 82</span> </div><divclass="line"><aname="l00086"></a><spanclass="lineno"> 86</span> <spanclass="keywordtype">void</span><aclass="code"href="group__malloc.html#gaf2c7b89c327d1f60f59e68b9ea644d95">mi_free</a>(<spanclass="keywordtype">void</span>* p);</div><divclass="line"><aname="l00087"></a><spanclass="lineno"> 87</span> </div><divclass="line"><aname="l00092"></a><spanclass="lineno"> 92</span> <spanclass="keywordtype">void</span>* <aclass="code"href="group__malloc.html#ga3406e8b168bc74c8637b11571a6da83a">mi_malloc</a>(<spanclass="keywordtype">size_t</span> size);</div><divclass="line"><aname="l00093"></a><spanclass="lineno"> 93</span> </div><divclass="line"><aname="l00098"></a><spanclass="lineno"> 98</span> <spanclass="keywordtype">void</span>* <aclass="code"href="group__malloc.html#gafdd9d8bb2986e668ba9884f28af38000">mi_zalloc</a>(<spanclass="keywordtype">size_t</span> size);</div><divclass="line"><aname="l00099"></a><spanclass="lineno"> 99</span> </div><divclass="line"><aname="l00109"></a><spanclass="lineno"> 109</span> <spanclass="keywordtype">void</span>* <aclass="code"href="group__malloc.html#ga97fedb4f7107c592fd7f0f0a8949a57d">mi_calloc</a>(<spanclass="keywordtype">size_t</span> count, <spanclass="keywordtype">size_t</span> size);</div><divclass="line"><aname="l00110"></a><spanclass="lineno"> 110</span> </div><divclass="line"><aname="l00123"></a><spanclass="lineno"> 123</span> <spanclass="keywordtype">void</span>* <aclass="code"href="group__malloc.html#gaf11eb497da57bdfb2de65eb191c69db6">mi_realloc</a>(<spanclass="keywordtype">void</span>* p, <spanclass="keywordtype">size_t</span> newsize);</div><divclass="line"><aname="l00124"></a><spanclass="lineno"> 124</span> </div><divclass="line"><aname="l00135"></a><spanclass="lineno"> 135</span> <spanclass="keywordtype">void</span>* <aclass="code"href="group__malloc.html#ga23a0fbb452b5dce8e31fab1a1958cacc">mi_recalloc</a>(<spanclass="keywordtype">void</span>* p, <spanclass="keywordtype">size_t</span> count, <spanclass="keywordtype">size_t</span> size);</div><divclass="line"><aname="l00136"></a><spanclass="lineno"> 136</span> </div><divclass="line"><aname="l00150"></a><spanclass="lineno"> 150</span> <spanclass="keywordtype">void</span>* <aclass="code"href="group__malloc.html#gaaee66
<divclass="ttc"id="group__extended_html_ga089c859d9eddc5f9b4bd946cd53cebee"><divclass="ttname"><ahref="group__extended.html#ga089c859d9eddc5f9b4bd946cd53cebee">mi_usable_size</a></div><divclass="ttdeci">size_t mi_usable_size(void *p)</div><divclass="ttdoc">Return the available bytes in a memory block.</div></div>
<divclass="ttc"id="group__malloc_html_ga61d57b4144ba24fba5c1e9b956d13853"><divclass="ttname"><ahref="group__malloc.html#ga61d57b4144ba24fba5c1e9b956d13853">mi_reallocn</a></div><divclass="ttdeci">void * mi_reallocn(void *p, size_t count, size_t size)</div><divclass="ttdoc">Re-allocate memory to count elements of size bytes.</div></div>
<divclass="ttc"id="group__malloc_html_ga23a0fbb452b5dce8e31fab1a1958cacc"><divclass="ttname"><ahref="group__malloc.html#ga23a0fbb452b5dce8e31fab1a1958cacc">mi_recalloc</a></div><divclass="ttdeci">void * mi_recalloc(void *p, size_t count, size_t size)</div><divclass="ttdoc">Re-allocate memory to count elements of size bytes, with extra memory initialized to zero.</div></div>
<divclass="ttc"id="group__malloc_html_ga0b05e2bf0f73e7401ae08597ff782ac6"><divclass="ttname"><ahref="group__malloc.html#ga0b05e2bf0f73e7401ae08597ff782ac6">mi_mallocn</a></div><divclass="ttdeci">void * mi_mallocn(size_t count, size_t size)</div><divclass="ttdoc">Allocate count elements of size bytes.</div></div>
<divclass="ttc"id="group__extended_html_gac0f4849256aaf677f334690952c6ebbd"><divclass="ttname"><ahref="group__extended.html#gac0f4849256aaf677f334690952c6ebbd">mi_thread_done</a></div><divclass="ttdeci">void mi_thread_done()</div><divclass="ttdoc">Uninitialize mimalloc on a thread.</div></div>
<divclass="ttc"id="group__options_html_ggafebf7ed116adb38ae5218bc3ce06884cac2157a0cb79cd996c1db7d9f6a090c07"><divclass="ttname"><ahref="group__options.html#ggafebf7ed116adb38ae5218bc3ce06884cac2157a0cb79cd996c1db7d9f6a090c07">mi_option_cache_reset</a></div><divclass="ttdoc">Reset segment memory when a segment is cached.</div><divclass="ttdef"><b>Definition:</b> mimalloc-doc.h:622</div></div>
<divclass="ttc"id="group__options_html_ga7ef623e440e6e5545cb08c94e71e4b90"><divclass="ttname"><ahref="group__options.html#ga7ef623e440e6e5545cb08c94e71e4b90">mi_option_set_default</a></div><divclass="ttdeci">void mi_option_set_default(mi_option_t option, long value)</div></div>
<divclass="ttc"id="group__heap_html_ga903104592c8ed53417a3762da6241133"><divclass="ttname"><ahref="group__heap.html#ga903104592c8ed53417a3762da6241133">mi_heap_zalloc</a></div><divclass="ttdeci">void * mi_heap_zalloc(mi_heap_t *heap, size_t size)</div><divclass="ttdoc">Allocate zero-initialized in a specific heap.</div></div>
<divclass="ttc"id="group__options_html_gaf84921c32375e25754dc2ee6a911fa60"><divclass="ttname"><ahref="group__options.html#gaf84921c32375e25754dc2ee6a911fa60">mi_option_set</a></div><divclass="ttdeci">void mi_option_set(mi_option_t option, long value)</div></div>
<divclass="ttc"id="group__options_html_ggafebf7ed116adb38ae5218bc3ce06884ca32ce97ece29f69e82579679cf8a307ad"><divclass="ttname"><ahref="group__options.html#ggafebf7ed116adb38ae5218bc3ce06884ca32ce97ece29f69e82579679cf8a307ad">mi_option_eager_region_commit</a></div><divclass="ttdoc">Eagerly commit large (256MiB) memory regions (enabled by default except on Windows)</div><divclass="ttdef"><b>Definition:</b> mimalloc-doc.h:619</div></div>
<divclass="ttc"id="group__extended_html_ga490826cbd7c494acc9fe69be23f018ac"><divclass="ttname"><ahref="group__extended.html#ga490826cbd7c494acc9fe69be23f018ac">mi_thread_stats_print</a></div><divclass="ttdeci">void mi_thread_stats_print(FILE *out)</div><divclass="ttdoc">Print out heap statistics for this thread.</div></div>
<divclass="ttc"id="group__analysis_html_ae0085e6e1cf059a4eb7767e30e9991b8"><divclass="ttname"><ahref="group__analysis.html#ae0085e6e1cf059a4eb7767e30e9991b8">mi_heap_area_t::blocks</a></div><divclass="ttdeci">void * blocks</div><divclass="ttdoc">start of the area containing heap blocks</div><divclass="ttdef"><b>Definition:</b> mimalloc-doc.h:573</div></div>
<divclass="ttc"id="group__heap_html_ga139d6b09dbf50c3c2523d0f4d1cfdeb5"><divclass="ttname"><ahref="group__heap.html#ga139d6b09dbf50c3c2523d0f4d1cfdeb5">mi_heap_strdup</a></div><divclass="ttdeci">char * mi_heap_strdup(mi_heap_t *heap, const char *s)</div><divclass="ttdoc">Duplicate a string in a specific heap.</div></div>
<divclass="ttc"id="group__heap_html_ga00e95ba1e01acac3cfd95bb7a357a6f0"><divclass="ttname"><ahref="group__heap.html#ga00e95ba1e01acac3cfd95bb7a357a6f0">mi_heap_realpath</a></div><divclass="ttdeci">char * mi_heap_realpath(mi_heap_t *heap, const char *fname, char *resolved_name)</div><divclass="ttdoc">Resolve a file path name using a specific heap to allocate the result.</div></div>
<divclass="ttc"id="group__extended_html_ga220f29f40a44404b0061c15bc1c31152"><divclass="ttname"><ahref="group__extended.html#ga220f29f40a44404b0061c15bc1c31152">mi_zalloc_small</a></div><divclass="ttdeci">void * mi_zalloc_small(size_t size)</div><divclass="ttdoc">Allocate a zero initialized small object.</div></div>
<divclass="ttc"id="group__malloc_html_gaaabf971c2571891433477e2d21a35266"><divclass="ttname"><ahref="group__malloc.html#gaaabf971c2571891433477e2d21a35266">mi_strndup</a></div><divclass="ttdeci">char * mi_strndup(const char *s, size_t n)</div><divclass="ttdoc">Allocate and duplicate a string up to n bytes.</div></div>
<divclass="ttc"id="group__malloc_html_gaaee66a1d483c3e28f585525fb96707e4"><divclass="ttname"><ahref="group__malloc.html#gaaee66a1d483c3e28f585525fb96707e4">mi_expand</a></div><divclass="ttdeci">void * mi_expand(void *p, size_t newsize)</div><divclass="ttdoc">Try to re-allocate memory to newsize bytes in place.</div></div>
<divclass="ttc"id="group__extended_html_ga9398517f01a1ec971244aa0db084ea46"><divclass="ttname"><ahref="group__extended.html#ga9398517f01a1ec971244aa0db084ea46">mi_thread_init</a></div><divclass="ttdeci">void mi_thread_init()</div><divclass="ttdoc">Initialize mimalloc on a thread.</div></div>
<divclass="ttc"id="group__heap_html_gaa6702b3c48e9e53e50e81b36f5011d55"><divclass="ttname"><ahref="group__heap.html#gaa6702b3c48e9e53e50e81b36f5011d55">mi_heap_calloc</a></div><divclass="ttdeci">void * mi_heap_calloc(mi_heap_t *heap, size_t count, size_t size)</div><divclass="ttdoc">Allocate count zero-initialized elements in a specific heap.</div></div>
<divclass="ttc"id="group__analysis_html_a332a6c14d736a99699d5453a1cb04b41"><divclass="ttname"><ahref="group__analysis.html#a332a6c14d736a99699d5453a1cb04b41">mi_heap_area_t::block_size</a></div><divclass="ttdeci">size_t block_size</div><divclass="ttdoc">size in bytes of one block</div><divclass="ttdef"><b>Definition:</b> mimalloc-doc.h:577</div></div>
<divclass="ttc"id="group__options_html_ggafebf7ed116adb38ae5218bc3ce06884cada854dd272c66342f18a93ee254a2968"><divclass="ttname"><ahref="group__options.html#ggafebf7ed116adb38ae5218bc3ce06884cada854dd272c66342f18a93ee254a2968">mi_option_page_reset</a></div><divclass="ttdoc">Reset page memory when it becomes free.</div><divclass="ttdef"><b>Definition:</b> mimalloc-doc.h:621</div></div>
<divclass="ttc"id="group__analysis_html_ga70c46687dc6e9dc98b232b02646f8bed"><divclass="ttname"><ahref="group__analysis.html#ga70c46687dc6e9dc98b232b02646f8bed">mi_heap_visit_blocks</a></div><divclass="ttdeci">bool mi_heap_visit_blocks(const mi_heap_t *heap, bool visit_all_blocks, mi_block_visit_fun *visitor, void *arg)</div><divclass="ttdoc">Visit all areas and blocks in a heap.</div></div>
<divclass="ttc"id="group__heap_html_ga8e3dbd46650dd26573cf307a2c8f1f5a"><divclass="ttname"><ahref="group__heap.html#ga8e3dbd46650dd26573cf307a2c8f1f5a">mi_heap_strndup</a></div><divclass="ttdeci">char * mi_heap_strndup(mi_heap_t *heap, const char *s, size_t n)</div><divclass="ttdoc">Duplicate a string of at most length n in a specific heap.</div></div>
<divclass="ttc"id="group__analysis_html_gadfa01e2900f0e5d515ad5506b26f6d65"><divclass="ttname"><ahref="group__analysis.html#gadfa01e2900f0e5d515ad5506b26f6d65">mi_block_visit_fun</a></div><divclass="ttdeci">bool() mi_block_visit_fun(const mi_heap_t *heap, const mi_heap_area_t *area, void *block, size_t block_size, void *arg)</div><divclass="ttdoc">Visitor function passed to mi_heap_visit_blocks()</div><divclass="ttdef"><b>Definition:</b> mimalloc-doc.h:587</div></div>
<divclass="ttc"id="group__posix_html_gab5e29558926d934c3f1cae8c815f942c"><divclass="ttname"><ahref="group__posix.html#gab5e29558926d934c3f1cae8c815f942c">mi_new_aligned_nothrow</a></div><divclass="ttdeci">void * mi_new_aligned_nothrow(size_t n, size_t alignment)</div><divclass="ttdoc">return NULL on failure.</div></div>
<divclass="ttc"id="group__posix_html_gaeaded64eda71ed6b1d569d3e723abc4a"><divclass="ttname"><ahref="group__posix.html#gaeaded64eda71ed6b1d569d3e723abc4a">mi_new_nothrow</a></div><divclass="ttdeci">void * mi_new_nothrow(size_t n)</div><divclass="ttdoc">return NULL on failure.</div></div>
<divclass="ttc"id="group__analysis_html_gaa862aa8ed8d57d84cae41fc1022d71af"><divclass="ttname"><ahref="group__analysis.html#gaa862aa8ed8d57d84cae41fc1022d71af">mi_heap_contains_block</a></div><divclass="ttdeci">bool mi_heap_contains_block(mi_heap_t *heap, const void *p)</div><divclass="ttdoc">Does a heap contain a pointer to a previously allocated block?</div></div>
<divclass="ttc"id="group__aligned_html_ga5850da130c936bd77db039dcfbc8295d"><divclass="ttname"><ahref="group__aligned.html#ga5850da130c936bd77db039dcfbc8295d">mi_malloc_aligned_at</a></div><divclass="ttdeci">void * mi_malloc_aligned_at(size_t size, size_t alignment, size_t offset)</div><divclass="ttdoc">Allocate size bytes aligned by alignment at a specified offset.</div></div>
<divclass="ttc"id="group__heap_html_ga2ab1af8d438819b55319c7ef51d1e409"><divclass="ttname"><ahref="group__heap.html#ga2ab1af8d438819b55319c7ef51d1e409">mi_heap_delete</a></div><divclass="ttdeci">void mi_heap_delete(mi_heap_t *heap)</div><divclass="ttdoc">Delete a previously allocated heap.</div></div>
<divclass="ttc"id="group__heap_html_ga8db4cbb87314a989a9a187464d6b5e05"><divclass="ttname"><ahref="group__heap.html#ga8db4cbb87314a989a9a187464d6b5e05">mi_heap_get_default</a></div><divclass="ttdeci">mi_heap_t * mi_heap_get_default()</div><divclass="ttdoc">Get the default heap that is used for mi_malloc() et al.</div></div>
<divclass="ttc"id="group__extended_html_gac057927cd06c854b45fe7847e921bd47"><divclass="ttname"><ahref="group__extended.html#gac057927cd06c854b45fe7847e921bd47">mi_good_size</a></div><divclass="ttdeci">size_t mi_good_size(size_t size)</div><divclass="ttdoc">Return the used allocation size.</div></div>
<divclass="ttc"id="group__heap_html_ga851da6c43fe0b71c1376cee8aef90db0"><divclass="ttname"><ahref="group__heap.html#ga851da6c43fe0b71c1376cee8aef90db0">mi_heap_mallocn</a></div><divclass="ttdeci">void * mi_heap_mallocn(mi_heap_t *heap, size_t count, size_t size)</div><divclass="ttdoc">Allocate count elements in a specific heap.</div></div>
<divclass="ttc"id="group__analysis_html_structmi__heap__area__t"><divclass="ttname"><ahref="group__analysis.html#structmi__heap__area__t">mi_heap_area_t</a></div><divclass="ttdoc">An area of heap space contains blocks of a single size.</div><divclass="ttdef"><b>Definition:</b> mimalloc-doc.h:572</div></div>
<divclass="ttc"id="group__options_html_ggafebf7ed116adb38ae5218bc3ce06884ca0957ef73b2550764b4840edf48422fda"><divclass="ttname"><ahref="group__options.html#ggafebf7ed116adb38ae5218bc3ce06884ca0957ef73b2550764b4840edf48422fda">mi_option_show_stats</a></div><divclass="ttdoc">Print statistics to stderr when the program is done.</div><divclass="ttdef"><b>Definition:</b> mimalloc-doc.h:613</div></div>
<divclass="ttc"id="group__analysis_html_ae848a3e6840414891035423948ca0383"><divclass="ttname"><ahref="group__analysis.html#ae848a3e6840414891035423948ca0383">mi_heap_area_t::reserved</a></div><divclass="ttdeci">size_t reserved</div><divclass="ttdoc">bytes reserved for this area</div><divclass="ttdef"><b>Definition:</b> mimalloc-doc.h:574</div></div>
<divclass="ttc"id="group__heap_html_ga34a47cde5a5b38c29f1aa3c5e76943c2"><divclass="ttname"><ahref="group__heap.html#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a></div><divclass="ttdeci">struct mi_heap_s mi_heap_t</div><divclass="ttdoc">Type of first-class heaps.</div><divclass="ttdef"><b>Definition:</b> mimalloc-doc.h:407</div></div>
<divclass="ttc"id="group__analysis_html_ab820302c5cd0df133eb8e51650a008b4"><divclass="ttname"><ahref="group__analysis.html#ab820302c5cd0df133eb8e51650a008b4">mi_heap_area_t::used</a></div><divclass="ttdeci">size_t used</div><divclass="ttdoc">bytes in use by allocated blocks</div><divclass="ttdef"><b>Definition:</b> mimalloc-doc.h:576</div></div>
<divclass="ttc"id="group__extended_html_ga22213691c3ce5ab4d91b24aff1023529"><divclass="ttname"><ahref="group__extended.html#ga22213691c3ce5ab4d91b24aff1023529">mi_deferred_free_fun</a></div><divclass="ttdeci">void() mi_deferred_free_fun(bool force, unsigned long long heartbeat)</div><divclass="ttdoc">Type of deferred free functions.</div><divclass="ttdef"><b>Definition:</b> mimalloc-doc.h:327</div></div>
<divclass="ttc"id="group__heap_html_ga9f9c0844edb9717f4feacd79116b8e0d"><divclass="ttname"><ahref="group__heap.html#ga9f9c0844edb9717f4feacd79116b8e0d">mi_heap_destroy</a></div><divclass="ttdeci">void mi_heap_destroy(mi_heap_t *heap)</div><divclass="ttdoc">Destroy a heap, freeing all its still allocated blocks.</div></div>
<divclass="ttc"id="group__options_html_ggafebf7ed116adb38ae5218bc3ce06884ca4192d491200d0055df0554d4cf65054e"><divclass="ttname"><ahref="group__options.html#ggafebf7ed116adb38ae5218bc3ce06884ca4192d491200d0055df0554d4cf65054e">mi_option_large_os_pages</a></div><divclass="ttdoc">Use large OS pages if possible.</div><divclass="ttdef"><b>Definition:</b> mimalloc-doc.h:620</div></div>
<divclass="ttc"id="group__malloc_html_gac7cffe13f1f458ed16789488bf92b9b2"><divclass="ttname"><ahref="group__malloc.html#gac7cffe13f1f458ed16789488bf92b9b2">mi_strdup</a></div><divclass="ttdeci">char * mi_strdup(const char *s)</div><divclass="ttdoc">Allocate and duplicate a string.</div></div>
<divclass="ttc"id="group__extended_html_ga7136c2e55cb22c98ecf95d08d6debb99"><divclass="ttname"><ahref="group__extended.html#ga7136c2e55cb22c98ecf95d08d6debb99">mi_malloc_small</a></div><divclass="ttdeci">void * mi_malloc_small(size_t size)</div><divclass="ttdoc">Allocate a small object.</div></div>
<divclass="ttc"id="group__analysis_html_ga628c237489c2679af84a4d0d143b3dd5"><divclass="ttname"><ahref="group__analysis.html#ga628c237489c2679af84a4d0d143b3dd5">mi_check_owned</a></div><divclass="ttdeci">bool mi_check_owned(const void *p)</div><divclass="ttdoc">Check safely if any pointer is part of the default heap of this thread.</div></div>
<divclass="ttc"id="group__heap_html_ga766f672ba56f2fbfeb9d9dbb0b7f6b11"><divclass="ttname"><ahref="group__heap.html#ga766f672ba56f2fbfeb9d9dbb0b7f6b11">mi_heap_new</a></div><divclass="ttdeci">mi_heap_t * mi_heap_new()</div><divclass="ttdoc">Create a new heap that can be used for allocation.</div></div>
<divclass="ttc"id="group__heap_html_ga9cbed01e42c0647907295de92c3fa296"><divclass="ttname"><ahref="group__heap.html#ga9cbed01e42c0647907295de92c3fa296">mi_heap_malloc</a></div><divclass="ttdeci">void * mi_heap_malloc(mi_heap_t *heap, size_t size)</div><divclass="ttdoc">Allocate in a specific heap.</div></div>
<divclass="ttc"id="group__analysis_html_ab47526df656d8837ec3e97f11b83f835"><divclass="ttname"><ahref="group__analysis.html#ab47526df656d8837ec3e97f11b83f835">mi_heap_area_t::committed</a></div><divclass="ttdeci">size_t committed</div><divclass="ttdoc">current committed bytes of this area</div><divclass="ttdef"><b>Definition:</b> mimalloc-doc.h:575</div></div>
<divclass="ttc"id="group__analysis_html_ga0d67c1789faaa15ff366c024fcaf6377"><divclass="ttname"><ahref="group__analysis.html#ga0d67c1789faaa15ff366c024fcaf6377">mi_heap_check_owned</a></div><divclass="ttdeci">bool mi_heap_check_owned(mi_heap_t *heap, const void *p)</div><divclass="ttdoc">Check safely if any pointer is part of a heap.</div></div>
<divclass="ttc"id="group__heap_html_gab8631ec88c8d26641b68b5d25dcd4422"><divclass="ttname"><ahref="group__heap.html#gab8631ec88c8d26641b68b5d25dcd4422">mi_heap_set_default</a></div><divclass="ttdeci">mi_heap_t * mi_heap_set_default(mi_heap_t *heap)</div><divclass="ttdoc">Set the default heap to use for mi_malloc() et al.</div></div>