libmimalloc-sys2 0.1.53

Sys crate wrapping the mimalloc allocator
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>mi-malloc: Arenas</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  $(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="mimalloc-doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="mimalloc-logo.svg"/></td>
  <td id="projectalign">
   <div id="projectname">mi-malloc<span id="projectnumber">&#160;1.8/2.1</span>
   </div>
  </td>
    <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('group__arenas.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">Arenas</div></div>
</div><!--header-->
<div class="contents">

<p>Arenas are large memory areas (usually 1GiB+) from which mimalloc allocates memory.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga99fe38650d0b02e0e0f89ee024db91d3" id="r_ga99fe38650d0b02e0e0f89ee024db91d3"><td class="memItemLeft" align="right" valign="top">typedef int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga99fe38650d0b02e0e0f89ee024db91d3">mi_arena_id_t</a></td></tr>
<tr class="memdesc:ga99fe38650d0b02e0e0f89ee024db91d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Each arena has an associated identifier.  <br /></td></tr>
<tr class="separator:ga99fe38650d0b02e0e0f89ee024db91d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga00ec3324b6b2591c7fe3677baa30a767" id="r_ga00ec3324b6b2591c7fe3677baa30a767"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga00ec3324b6b2591c7fe3677baa30a767">mi_reserve_os_memory</a> (size_t size, bool commit, bool allow_large)</td></tr>
<tr class="memdesc:ga00ec3324b6b2591c7fe3677baa30a767"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reserve OS memory for use by mimalloc.  <br /></td></tr>
<tr class="separator:ga00ec3324b6b2591c7fe3677baa30a767"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga32f519797fd9a81acb4f52d36e6d751b" id="r_ga32f519797fd9a81acb4f52d36e6d751b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga32f519797fd9a81acb4f52d36e6d751b">mi_reserve_os_memory_ex</a> (size_t size, bool commit, bool allow_large, bool exclusive, <a class="el" href="#ga99fe38650d0b02e0e0f89ee024db91d3">mi_arena_id_t</a> *arena_id)</td></tr>
<tr class="memdesc:ga32f519797fd9a81acb4f52d36e6d751b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reserve OS memory to be managed in an arena.  <br /></td></tr>
<tr class="separator:ga32f519797fd9a81acb4f52d36e6d751b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3132f521fb756fc0e8ec0b74fb58df50" id="r_ga3132f521fb756fc0e8ec0b74fb58df50"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga3132f521fb756fc0e8ec0b74fb58df50">mi_reserve_huge_os_pages_interleave</a> (size_t pages, size_t numa_nodes, size_t timeout_msecs)</td></tr>
<tr class="memdesc:ga3132f521fb756fc0e8ec0b74fb58df50"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reserve <em>pages</em> of huge OS pages (1GiB) evenly divided over <em>numa_nodes</em> nodes, but stops after at most <code>timeout_msecs</code> seconds.  <br /></td></tr>
<tr class="separator:ga3132f521fb756fc0e8ec0b74fb58df50"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7795a13d20087447281858d2c771cca1" id="r_ga7795a13d20087447281858d2c771cca1"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga7795a13d20087447281858d2c771cca1">mi_reserve_huge_os_pages_at</a> (size_t pages, int numa_node, size_t timeout_msecs)</td></tr>
<tr class="memdesc:ga7795a13d20087447281858d2c771cca1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reserve <em>pages</em> of huge OS pages (1GiB) at a specific <em>numa_node</em>, but stops after at most <code>timeout_msecs</code> seconds.  <br /></td></tr>
<tr class="separator:ga7795a13d20087447281858d2c771cca1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga591aab1c2bc2ca920e33f0f9f9cb5c52" id="r_ga591aab1c2bc2ca920e33f0f9f9cb5c52"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga591aab1c2bc2ca920e33f0f9f9cb5c52">mi_reserve_huge_os_pages_at_ex</a> (size_t pages, int numa_node, size_t timeout_msecs, bool exclusive, <a class="el" href="#ga99fe38650d0b02e0e0f89ee024db91d3">mi_arena_id_t</a> *arena_id)</td></tr>
<tr class="memdesc:ga591aab1c2bc2ca920e33f0f9f9cb5c52"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reserve huge OS pages (1GiB) into a single arena.  <br /></td></tr>
<tr class="separator:ga591aab1c2bc2ca920e33f0f9f9cb5c52"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa1a59464dbf3bc972d34fca0f86668fc" id="r_gaa1a59464dbf3bc972d34fca0f86668fc"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#gaa1a59464dbf3bc972d34fca0f86668fc">mi_arena_min_alignment</a> (void)</td></tr>
<tr class="memdesc:gaa1a59464dbf3bc972d34fca0f86668fc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the minimal alignment required for managed OS memory.  <br /></td></tr>
<tr class="separator:gaa1a59464dbf3bc972d34fca0f86668fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4c6486a1fdcd7a423b5f25fe4be8e0cf" id="r_ga4c6486a1fdcd7a423b5f25fe4be8e0cf"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga4c6486a1fdcd7a423b5f25fe4be8e0cf">mi_manage_os_memory</a> (void *start, size_t size, bool is_committed, bool is_large, bool is_zero, int numa_node)</td></tr>
<tr class="memdesc:ga4c6486a1fdcd7a423b5f25fe4be8e0cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Manage a particular memory area for use by mimalloc.  <br /></td></tr>
<tr class="separator:ga4c6486a1fdcd7a423b5f25fe4be8e0cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga41ce8525d77bbb60f618fa1029994f6e" id="r_ga41ce8525d77bbb60f618fa1029994f6e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga41ce8525d77bbb60f618fa1029994f6e">mi_manage_os_memory_ex</a> (void *start, size_t size, bool is_committed, bool is_large, bool is_zero, int numa_node, bool exclusive, <a class="el" href="#ga99fe38650d0b02e0e0f89ee024db91d3">mi_arena_id_t</a> *arena_id)</td></tr>
<tr class="memdesc:ga41ce8525d77bbb60f618fa1029994f6e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Manage externally allocated memory as a mimalloc arena.  <br /></td></tr>
<tr class="separator:ga41ce8525d77bbb60f618fa1029994f6e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga98cda17aa7adeda8b213382af8e7810b" id="r_ga98cda17aa7adeda8b213382af8e7810b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga98cda17aa7adeda8b213382af8e7810b">mi_debug_show_arenas</a> (void)</td></tr>
<tr class="memdesc:ga98cda17aa7adeda8b213382af8e7810b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Show all current arena's.  <br /></td></tr>
<tr class="separator:ga98cda17aa7adeda8b213382af8e7810b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9a25a00a22151619a0be91a10af7787f" id="r_ga9a25a00a22151619a0be91a10af7787f"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga9a25a00a22151619a0be91a10af7787f">mi_arena_area</a> (<a class="el" href="#ga99fe38650d0b02e0e0f89ee024db91d3">mi_arena_id_t</a> arena_id, size_t *size)</td></tr>
<tr class="memdesc:ga9a25a00a22151619a0be91a10af7787f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the start and size of an arena.  <br /></td></tr>
<tr class="separator:ga9a25a00a22151619a0be91a10af7787f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaf2d9976576d5efd5544be12848af949" id="r_gaaf2d9976576d5efd5544be12848af949"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__heap.html#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#gaaf2d9976576d5efd5544be12848af949">mi_heap_new_in_arena</a> (<a class="el" href="#ga99fe38650d0b02e0e0f89ee024db91d3">mi_arena_id_t</a> arena_id)</td></tr>
<tr class="memdesc:gaaf2d9976576d5efd5544be12848af949"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new heap that only allocates in the specified arena.  <br /></td></tr>
<tr class="separator:gaaf2d9976576d5efd5544be12848af949"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3ae360583f4351aa5267ee7e43008faf" id="r_ga3ae360583f4351aa5267ee7e43008faf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__heap.html#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga3ae360583f4351aa5267ee7e43008faf">mi_heap_new_ex</a> (int heap_tag, bool allow_destroy, <a class="el" href="#ga99fe38650d0b02e0e0f89ee024db91d3">mi_arena_id_t</a> arena_id)</td></tr>
<tr class="memdesc:ga3ae360583f4351aa5267ee7e43008faf"><td class="mdescLeft">&#160;</td><td class="mdescRight"><b>v1</b>,<b>v2</b>: Create a new heap.  <br /></td></tr>
<tr class="separator:ga3ae360583f4351aa5267ee7e43008faf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Arenas are large memory areas (usually 1GiB+) from which mimalloc allocates memory. </p>
<p>The arenas are usually allocated on-demand from the OS but can be reserved explicitly. It is also possible to give previously allocated memory to mimalloc to manage. Heaps can be associated with a specific arena to only allocate memory from that arena. </p>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga99fe38650d0b02e0e0f89ee024db91d3" name="ga99fe38650d0b02e0e0f89ee024db91d3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga99fe38650d0b02e0e0f89ee024db91d3">&#9670;&#160;</a></span>mi_arena_id_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int <a class="el" href="#ga99fe38650d0b02e0e0f89ee024db91d3">mi_arena_id_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Each arena has an associated identifier. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga9a25a00a22151619a0be91a10af7787f" name="ga9a25a00a22151619a0be91a10af7787f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9a25a00a22151619a0be91a10af7787f">&#9670;&#160;</a></span>mi_arena_area()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void * mi_arena_area </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="#ga99fe38650d0b02e0e0f89ee024db91d3">mi_arena_id_t</a></td>          <td class="paramname"><span class="paramname"><em>arena_id</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *</td>          <td class="paramname"><span class="paramname"><em>size</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the start and size of an arena. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">arena_id</td><td>The arena identifier. </td></tr>
    <tr><td class="paramname">size</td><td>Returned size in bytes of the (virtual) arena area. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>base address of the arena. </dd></dl>

</div>
</div>
<a id="gaa1a59464dbf3bc972d34fca0f86668fc" name="gaa1a59464dbf3bc972d34fca0f86668fc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa1a59464dbf3bc972d34fca0f86668fc">&#9670;&#160;</a></span>mi_arena_min_alignment()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t mi_arena_min_alignment </td>
          <td>(</td>
          <td class="paramtype">void</td>          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the minimal alignment required for managed OS memory. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="#ga4c6486a1fdcd7a423b5f25fe4be8e0cf" title="Manage a particular memory area for use by mimalloc.">mi_manage_os_memory()</a>, <a class="el" href="#ga41ce8525d77bbb60f618fa1029994f6e" title="Manage externally allocated memory as a mimalloc arena.">mi_manage_os_memory_ex()</a> </dd></dl>

</div>
</div>
<a id="ga98cda17aa7adeda8b213382af8e7810b" name="ga98cda17aa7adeda8b213382af8e7810b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga98cda17aa7adeda8b213382af8e7810b">&#9670;&#160;</a></span>mi_debug_show_arenas()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mi_debug_show_arenas </td>
          <td>(</td>
          <td class="paramtype">void</td>          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Show all current arena's. </p>

</div>
</div>
<a id="ga3ae360583f4351aa5267ee7e43008faf" name="ga3ae360583f4351aa5267ee7e43008faf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3ae360583f4351aa5267ee7e43008faf">&#9670;&#160;</a></span>mi_heap_new_ex()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__heap.html#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> * mi_heap_new_ex </td>
          <td>(</td>
          <td class="paramtype">int</td>          <td class="paramname"><span class="paramname"><em>heap_tag</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>allow_destroy</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="#ga99fe38650d0b02e0e0f89ee024db91d3">mi_arena_id_t</a></td>          <td class="paramname"><span class="paramname"><em>arena_id</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p><b>v1</b>,<b>v2</b>: Create a new heap. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">heap_tag</td><td>The heap tag associated with this heap; heaps only reclaim memory between heaps with the same tag. </td></tr>
    <tr><td class="paramname">allow_destroy</td><td>Is <em>mi_heap_destroy</em> allowed? Not allowing this allows the heap to reclaim memory from terminated threads. </td></tr>
    <tr><td class="paramname">arena_id</td><td>If not 0, the heap will only allocate from the specified arena. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A new heap or <code>NULL</code> on failure.</dd></dl>
<p>The <em>arena_id</em> can be used by runtimes to allocate only in a specified pre-reserved arena. This is used for example for a compressed pointer heap in Koka. The <em>heap_tag</em> enables heaps to keep objects of a certain type isolated to heaps with that tag. This is used for example in the CPython integration. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="#gaaf2d9976576d5efd5544be12848af949" title="Create a new heap that only allocates in the specified arena.">mi_heap_new_in_arena()</a> for <b>v3</b> </dd></dl>

</div>
</div>
<a id="gaaf2d9976576d5efd5544be12848af949" name="gaaf2d9976576d5efd5544be12848af949"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaf2d9976576d5efd5544be12848af949">&#9670;&#160;</a></span>mi_heap_new_in_arena()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__heap.html#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> * mi_heap_new_in_arena </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="#ga99fe38650d0b02e0e0f89ee024db91d3">mi_arena_id_t</a></td>          <td class="paramname"><span class="paramname"><em>arena_id</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a new heap that only allocates in the specified arena. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">arena_id</td><td>The arena identifier. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new heap or <code>NULL</code>. </dd></dl>

</div>
</div>
<a id="ga4c6486a1fdcd7a423b5f25fe4be8e0cf" name="ga4c6486a1fdcd7a423b5f25fe4be8e0cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4c6486a1fdcd7a423b5f25fe4be8e0cf">&#9670;&#160;</a></span>mi_manage_os_memory()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool mi_manage_os_memory </td>
          <td>(</td>
          <td class="paramtype">void *</td>          <td class="paramname"><span class="paramname"><em>start</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>size</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>is_committed</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>is_large</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>is_zero</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int</td>          <td class="paramname"><span class="paramname"><em>numa_node</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Manage a particular memory area for use by mimalloc. </p>
<p>This is just like <code>mi_reserve_os_memory</code> except that the area should already be allocated in some manner and available for use my mimalloc. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">start</td><td>Start of the memory area </td></tr>
    <tr><td class="paramname">size</td><td>The size of the memory area. </td></tr>
    <tr><td class="paramname">is_committed</td><td>Is the area already committed? </td></tr>
    <tr><td class="paramname">is_large</td><td>Does it consist of large OS pages? Set this to <em>true</em> as well for memory that should not be decommitted or protected (like rdma etc.) </td></tr>
    <tr><td class="paramname">is_zero</td><td>Does the area consists of zero's? </td></tr>
    <tr><td class="paramname">numa_node</td><td>Possible associated numa node or <code>-1</code>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if successful, and <em>false</em> on error. </dd></dl>

</div>
</div>
<a id="ga41ce8525d77bbb60f618fa1029994f6e" name="ga41ce8525d77bbb60f618fa1029994f6e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga41ce8525d77bbb60f618fa1029994f6e">&#9670;&#160;</a></span>mi_manage_os_memory_ex()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool mi_manage_os_memory_ex </td>
          <td>(</td>
          <td class="paramtype">void *</td>          <td class="paramname"><span class="paramname"><em>start</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>size</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>is_committed</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>is_large</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>is_zero</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int</td>          <td class="paramname"><span class="paramname"><em>numa_node</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>exclusive</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="#ga99fe38650d0b02e0e0f89ee024db91d3">mi_arena_id_t</a> *</td>          <td class="paramname"><span class="paramname"><em>arena_id</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Manage externally allocated memory as a mimalloc arena. </p>
<p>This memory will not be freed by mimalloc. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">start</td><td>Start address of the area. </td></tr>
    <tr><td class="paramname">size</td><td>Size in bytes of the area. </td></tr>
    <tr><td class="paramname">is_committed</td><td>Is the memory already committed? </td></tr>
    <tr><td class="paramname">is_large</td><td>Does it consist of (pinned) large OS pages? </td></tr>
    <tr><td class="paramname">is_zero</td><td>Is the memory zero-initialized? </td></tr>
    <tr><td class="paramname">numa_node</td><td>Associated NUMA node, or -1 to have no NUMA preference. </td></tr>
    <tr><td class="paramname">exclusive</td><td>Is the arena exclusive (where only heaps associated with the arena can allocate in it) </td></tr>
    <tr><td class="paramname">arena_id</td><td>The new arena identifier. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if successful. </dd></dl>

</div>
</div>
<a id="ga7795a13d20087447281858d2c771cca1" name="ga7795a13d20087447281858d2c771cca1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7795a13d20087447281858d2c771cca1">&#9670;&#160;</a></span>mi_reserve_huge_os_pages_at()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mi_reserve_huge_os_pages_at </td>
          <td>(</td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>pages</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int</td>          <td class="paramname"><span class="paramname"><em>numa_node</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>timeout_msecs</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reserve <em>pages</em> of huge OS pages (1GiB) at a specific <em>numa_node</em>, but stops after at most <code>timeout_msecs</code> seconds. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pages</td><td>The number of 1GiB pages to reserve. </td></tr>
    <tr><td class="paramname">numa_node</td><td>The NUMA node where the memory is reserved (start at 0). Use -1 for no affinity. </td></tr>
    <tr><td class="paramname">timeout_msecs</td><td>Maximum number of milli-seconds to try reserving, or 0 for no timeout. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, <em>ENOMEM</em> if running out of memory, or <em>ETIMEDOUT</em> if timed out.</dd></dl>
<p>The reserved memory is used by mimalloc to satisfy allocations. May quit before <em>timeout_msecs</em> are expired if it estimates it will take more than 1.5 times <em>timeout_msecs</em>. The time limit is needed because on some operating systems it can take a long time to reserve contiguous memory if the physical memory is fragmented. </p>

</div>
</div>
<a id="ga591aab1c2bc2ca920e33f0f9f9cb5c52" name="ga591aab1c2bc2ca920e33f0f9f9cb5c52"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga591aab1c2bc2ca920e33f0f9f9cb5c52">&#9670;&#160;</a></span>mi_reserve_huge_os_pages_at_ex()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mi_reserve_huge_os_pages_at_ex </td>
          <td>(</td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>pages</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int</td>          <td class="paramname"><span class="paramname"><em>numa_node</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>timeout_msecs</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>exclusive</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="#ga99fe38650d0b02e0e0f89ee024db91d3">mi_arena_id_t</a> *</td>          <td class="paramname"><span class="paramname"><em>arena_id</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reserve huge OS pages (1GiB) into a single arena. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pages</td><td>Number of 1GiB pages to reserve. </td></tr>
    <tr><td class="paramname">numa_node</td><td>The associated NUMA node, or -1 for no NUMA preference. </td></tr>
    <tr><td class="paramname">timeout_msecs</td><td>Max amount of milli-seconds this operation is allowed to take. (0 is infinite) </td></tr>
    <tr><td class="paramname">exclusive</td><td>If exclusive, only a heap associated with this arena can allocate in it. </td></tr>
    <tr><td class="paramname">arena_id</td><td>The arena identifier. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, <em>ENOMEM</em> if running out of memory, or <em>ETIMEDOUT</em> if timed out. </dd></dl>

</div>
</div>
<a id="ga3132f521fb756fc0e8ec0b74fb58df50" name="ga3132f521fb756fc0e8ec0b74fb58df50"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3132f521fb756fc0e8ec0b74fb58df50">&#9670;&#160;</a></span>mi_reserve_huge_os_pages_interleave()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mi_reserve_huge_os_pages_interleave </td>
          <td>(</td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>pages</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>numa_nodes</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>timeout_msecs</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reserve <em>pages</em> of huge OS pages (1GiB) evenly divided over <em>numa_nodes</em> nodes, but stops after at most <code>timeout_msecs</code> seconds. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pages</td><td>The number of 1GiB pages to reserve. </td></tr>
    <tr><td class="paramname">numa_nodes</td><td>The number of nodes do evenly divide the pages over, or 0 for using the actual number of NUMA nodes. </td></tr>
    <tr><td class="paramname">timeout_msecs</td><td>Maximum number of milli-seconds to try reserving, or 0 for no timeout. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, <em>ENOMEM</em> if running out of memory, or <em>ETIMEDOUT</em> if timed out.</dd></dl>
<p>The reserved memory is used by mimalloc to satisfy allocations. May quit before <em>timeout_msecs</em> are expired if it estimates it will take more than 1.5 times <em>timeout_msecs</em>. The time limit is needed because on some operating systems it can take a long time to reserve contiguous memory if the physical memory is fragmented. </p>

</div>
</div>
<a id="ga00ec3324b6b2591c7fe3677baa30a767" name="ga00ec3324b6b2591c7fe3677baa30a767"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga00ec3324b6b2591c7fe3677baa30a767">&#9670;&#160;</a></span>mi_reserve_os_memory()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mi_reserve_os_memory </td>
          <td>(</td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>size</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>commit</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>allow_large</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reserve OS memory for use by mimalloc. </p>
<p>Reserved areas are used before allocating from the OS again. By reserving a large area upfront, allocation can be more efficient, and can be better managed on systems without <code>mmap</code>/<code>VirtualAlloc</code> (like WASM for example). </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">size</td><td>The size to reserve. </td></tr>
    <tr><td class="paramname">commit</td><td>Commit the memory upfront. </td></tr>
    <tr><td class="paramname">allow_large</td><td>Allow large OS pages (2MiB) to be used? </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><em>0</em> if successful, and an error code otherwise (e.g. <code>ENOMEM</code>). </dd></dl>

</div>
</div>
<a id="ga32f519797fd9a81acb4f52d36e6d751b" name="ga32f519797fd9a81acb4f52d36e6d751b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga32f519797fd9a81acb4f52d36e6d751b">&#9670;&#160;</a></span>mi_reserve_os_memory_ex()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int mi_reserve_os_memory_ex </td>
          <td>(</td>
          <td class="paramtype">size_t</td>          <td class="paramname"><span class="paramname"><em>size</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>commit</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>allow_large</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>exclusive</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="#ga99fe38650d0b02e0e0f89ee024db91d3">mi_arena_id_t</a> *</td>          <td class="paramname"><span class="paramname"><em>arena_id</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reserve OS memory to be managed in an arena. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">size</td><td>Size the reserve. </td></tr>
    <tr><td class="paramname">commit</td><td>Should the memory be initially committed? </td></tr>
    <tr><td class="paramname">allow_large</td><td>Allow the use of large OS pages? </td></tr>
    <tr><td class="paramname">exclusive</td><td>Is the returned arena exclusive? </td></tr>
    <tr><td class="paramname">arena_id</td><td>The new arena identifier. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Zero on success, an error code otherwise. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
  </ul>
</div>
</body>
</html>