mirror of
https://github.com/encounter/mimalloc.git
synced 2026-07-10 12:18:36 -07:00
Merge branch 'dev' into dev-slice
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018-2021 Microsoft Corporation, Daan Leijen
|
||||
Copyright (c) 2018-2025 Microsoft Corporation, Daan Leijen
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
+2
-1
@@ -8,7 +8,8 @@ trigger:
|
||||
include:
|
||||
- master
|
||||
- dev
|
||||
- dev-slice
|
||||
- dev2
|
||||
- dev3
|
||||
tags:
|
||||
include:
|
||||
- v*
|
||||
|
||||
+29
-24
@@ -1,5 +1,5 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
Copyright (c) 2018-2021, Microsoft Research, Daan Leijen
|
||||
Copyright (c) 2018-2025, Microsoft Research, Daan Leijen
|
||||
This is free software; you can redistribute it and/or modify it under the
|
||||
terms of the MIT license. A copy of the license can be found in the file
|
||||
"LICENSE" at the root of this distribution.
|
||||
@@ -1303,25 +1303,31 @@ the [shell](https://stackoverflow.com/questions/43941322/dyld-insert-libraries-i
|
||||
|
||||
### Dynamic Override on Windows
|
||||
|
||||
<span id="override_on_windows">Dynamically overriding on mimalloc on Windows</span>
|
||||
is robust and has the particular advantage to be able to redirect all malloc/free calls that go through
|
||||
the (dynamic) C runtime allocator, including those from other DLL's or libraries.
|
||||
As it intercepts all allocation calls on a low level, it can be used reliably
|
||||
<span id="override_on_windows">Dynamically overriding on mimalloc on Windows</span>
|
||||
is robust and has the particular advantage to be able to redirect all malloc/free calls
|
||||
that go through the (dynamic) C runtime allocator, including those from other DLL's or
|
||||
libraries. As it intercepts all allocation calls on a low level, it can be used reliably
|
||||
on large programs that include other 3rd party components.
|
||||
There are four requirements to make the overriding work robustly:
|
||||
There are four requirements to make the overriding work well:
|
||||
|
||||
1. Use the C-runtime library as a DLL (using the `/MD` or `/MDd` switch).
|
||||
2. Link your program explicitly with `mimalloc-override.dll` library.
|
||||
To ensure the `mimalloc-override.dll` is loaded at run-time it is easiest to insert some
|
||||
call to the mimalloc API in the `main` function, like `mi_version()`
|
||||
(or use the `/INCLUDE:mi_version` switch on the linker). See the `mimalloc-override-test` project
|
||||
for an example on how to use this.
|
||||
3. The [`mimalloc-redirect.dll`](bin) (or `mimalloc-redirect32.dll`) must be put
|
||||
in the same folder as the main `mimalloc-override.dll` at runtime (as it is a dependency of that DLL).
|
||||
The redirection DLL ensures that all calls to the C runtime malloc API get redirected to
|
||||
mimalloc functions (which reside in `mimalloc-override.dll`).
|
||||
4. Ensure the `mimalloc-override.dll` comes as early as possible in the import
|
||||
|
||||
2. Link your program explicitly with the `mimalloc.lib` export library for the `mimalloc.dll`.
|
||||
(which must be compiled with `-DMI_OVERRIDE=ON`, which is the default though).
|
||||
To ensure the `mimalloc.dll` is actually loaded at run-time it is easiest
|
||||
to insert some call to the mimalloc API in the `main` function, like `mi_version()`
|
||||
(or use the `/include:mi_version` switch on the linker command, or
|
||||
similarly, `#pragma comment(linker, "/include:mi_version")` in some source file).
|
||||
See the `mimalloc-test-override` project for an example on how to use this.
|
||||
|
||||
3. The `mimalloc-redirect.dll` must be put in the same directory as the main
|
||||
`mimalloc.dll` at runtime (as it is a dependency of that DLL).
|
||||
The redirection DLL ensures that all calls to the C runtime malloc API get
|
||||
redirected to mimalloc functions (which reside in `mimalloc.dll`).
|
||||
|
||||
4. Ensure the `mimalloc.dll` comes as early as possible in the import
|
||||
list of the final executable (so it can intercept all potential allocations).
|
||||
You can use `minject -l <exe>` to check this if needed.
|
||||
|
||||
For best performance on Windows with C++, it
|
||||
is also recommended to also override the `new`/`delete` operations (by including
|
||||
@@ -1329,15 +1335,14 @@ is also recommended to also override the `new`/`delete` operations (by including
|
||||
a single(!) source file in your project).
|
||||
|
||||
The environment variable `MIMALLOC_DISABLE_REDIRECT=1` can be used to disable dynamic
|
||||
overriding at run-time. Use `MIMALLOC_VERBOSE=1` to check if mimalloc was successfully redirected.
|
||||
overriding at run-time. Use `MIMALLOC_VERBOSE=1` to check if mimalloc was successfully
|
||||
redirected.
|
||||
|
||||
For different platforms than x64, you may need a specific [redirection dll](bin).
|
||||
Furthermore, we cannot always re-link an executable or ensure `mimalloc.dll` comes
|
||||
first in the import table. In such cases the [`minject`](bin) tool can be used
|
||||
to patch the executable's import tables.
|
||||
|
||||
We cannot always re-link an executable with `mimalloc-override.dll`, and similarly, we cannot always
|
||||
ensure the the DLL comes first in the import table of the final executable.
|
||||
In many cases though we can patch existing executables without any recompilation
|
||||
if they are linked with the dynamic C runtime (`ucrtbase.dll`) -- just put the `mimalloc-override.dll`
|
||||
into the import table (and put `mimalloc-redirect.dll` in the same folder)
|
||||
Such patching can be done for example with [CFF Explorer](https://ntcore.com/?page_id=388) or
|
||||
the [`minject`](bin) program.
|
||||
|
||||
## Static override
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ RUN mkdir -p /home/dev
|
||||
WORKDIR /home/dev
|
||||
|
||||
# Get mimalloc
|
||||
RUN git clone https://github.com/microsoft/mimalloc -b dev-slice
|
||||
RUN git clone https://github.com/microsoft/mimalloc -b dev2
|
||||
RUN mkdir -p mimalloc/out/release
|
||||
RUN mkdir -p mimalloc/out/debug
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ RUN mkdir -p /home/dev
|
||||
WORKDIR /home/dev
|
||||
|
||||
# Get mimalloc
|
||||
RUN git clone https://github.com/microsoft/mimalloc -b dev-slice
|
||||
RUN git clone https://github.com/microsoft/mimalloc -b dev2
|
||||
RUN mkdir -p mimalloc/out/release
|
||||
RUN mkdir -p mimalloc/out/debug
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ RUN mkdir -p /home/dev
|
||||
WORKDIR /home/dev
|
||||
|
||||
# Get mimalloc
|
||||
RUN git clone https://github.com/microsoft/mimalloc -b dev-slice
|
||||
RUN git clone https://github.com/microsoft/mimalloc -b dev2
|
||||
RUN mkdir -p mimalloc/out/release
|
||||
RUN mkdir -p mimalloc/out/debug
|
||||
|
||||
|
||||
+4
-4
@@ -3,7 +3,7 @@
|
||||
<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="generator" content="Doxygen 1.13.1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>mi-malloc: Data Structures</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.11.0 -->
|
||||
<!-- Generated by Doxygen 1.13.1 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
@@ -110,7 +110,7 @@ $(function(){initNavTree('annotated.html',''); initResizable(true); });
|
||||
<div class="textblock">Here are the data structures with brief descriptions:</div><div class="directory">
|
||||
<table class="directory">
|
||||
<tr id="row_0_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="group__analysis.html#structmi__heap__area__t" target="_self">mi_heap_area_t</a></td><td class="desc">An area of heap space contains blocks of a single size </td></tr>
|
||||
<tr id="row_1_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="group__cpp.html#structmi__stl__allocator" target="_self">mi_stl_allocator</a></td><td class="desc"><em>std::allocator</em> implementation for mimalloc for use in STL containers </td></tr>
|
||||
<tr id="row_1_" class="odd"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="group__cpp.html#structmi__stl__allocator" target="_self">mi_stl_allocator</a></td><td class="desc"><em class="arg">std::allocator</em> implementation for mimalloc for use in STL containers </td></tr>
|
||||
</table>
|
||||
</div><!-- directory -->
|
||||
</div><!-- contents -->
|
||||
@@ -118,7 +118,7 @@ $(function(){initNavTree('annotated.html',''); initResizable(true); });
|
||||
<!-- 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>
|
||||
<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.13.1 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@
|
||||
<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="generator" content="Doxygen 1.13.1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>mi-malloc: Performance</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.11.0 -->
|
||||
<!-- Generated by Doxygen 1.13.1 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
@@ -116,7 +116,7 @@ $(function(){initNavTree('bench.html',''); initResizable(true); });
|
||||
<!-- 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>
|
||||
<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.13.1 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@
|
||||
<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="generator" content="Doxygen 1.13.1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>mi-malloc: Building</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.11.0 -->
|
||||
<!-- Generated by Doxygen 1.13.1 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
@@ -139,7 +139,7 @@ $(function(){initNavTree('build.html',''); initResizable(true); });
|
||||
<!-- 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>
|
||||
<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.13.1 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@
|
||||
<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="generator" content="Doxygen 1.13.1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>mi-malloc: Data Structure Index</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.11.0 -->
|
||||
<!-- Generated by Doxygen 1.13.1 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
@@ -118,7 +118,7 @@ $(function(){initNavTree('classes.html',''); initResizable(true); });
|
||||
<!-- 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>
|
||||
<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.13.1 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
+25
-13
@@ -1,4 +1,4 @@
|
||||
/* The standard CSS for doxygen 1.11.0*/
|
||||
/* The standard CSS for doxygen 1.13.1*/
|
||||
|
||||
body {
|
||||
background-color: white;
|
||||
@@ -1057,7 +1057,7 @@ table.fieldtable {
|
||||
padding: 3px 7px 2px;
|
||||
}
|
||||
|
||||
.fieldtable td.fieldtype, .fieldtable td.fieldname {
|
||||
.fieldtable td.fieldtype, .fieldtable td.fieldname, .fieldtable td.fieldinit {
|
||||
white-space: nowrap;
|
||||
border-right: 1px solid #697273;
|
||||
border-bottom: 1px solid #697273;
|
||||
@@ -1068,6 +1068,12 @@ table.fieldtable {
|
||||
padding-top: 3px;
|
||||
}
|
||||
|
||||
.fieldtable td.fieldinit {
|
||||
padding-top: 3px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
||||
.fieldtable td.fielddoc {
|
||||
border-bottom: 1px solid #697273;
|
||||
}
|
||||
@@ -1416,6 +1422,11 @@ dl.invariant dt, dl.pre dt, dl.post dt {
|
||||
padding: 2px 0px;
|
||||
}
|
||||
|
||||
#side-nav #projectname
|
||||
{
|
||||
font-size: 130%;
|
||||
}
|
||||
|
||||
#projectbrief
|
||||
{
|
||||
font-size: 90%;
|
||||
@@ -1522,20 +1533,17 @@ div.toc ul {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
div.toc li[class^='level'] {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
div.toc li.level1 {
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
div.toc li.level2 {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
div.toc li.level3 {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
div.toc li.level4 {
|
||||
margin-left: 15px;
|
||||
div.toc li.empty {
|
||||
background-image: none;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
span.emoji {
|
||||
@@ -1806,10 +1814,14 @@ th.markdownTableHeadCenter, td.markdownTableBodyCenter {
|
||||
text-align: center
|
||||
}
|
||||
|
||||
tt, code, kbd, samp
|
||||
tt, code, kbd
|
||||
{
|
||||
display: inline-block;
|
||||
}
|
||||
tt, code, kbd
|
||||
{
|
||||
vertical-align: top;
|
||||
}
|
||||
/* @end */
|
||||
|
||||
u {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<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="generator" content="Doxygen 1.13.1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>mi-malloc: Environment Options</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.11.0 -->
|
||||
<!-- Generated by Doxygen 1.13.1 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
@@ -132,7 +132,7 @@ $(function(){initNavTree('environment.html',''); initResizable(true); });
|
||||
<!-- 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>
|
||||
<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.13.1 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@
|
||||
<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="generator" content="Doxygen 1.13.1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>mi-malloc: Data Fields</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.11.0 -->
|
||||
<!-- Generated by Doxygen 1.13.1 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
@@ -118,7 +118,7 @@ $(function(){initNavTree('functions.html',''); initResizable(true); });
|
||||
<!-- 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>
|
||||
<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.13.1 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<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="generator" content="Doxygen 1.13.1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>mi-malloc: Data Fields - Variables</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.11.0 -->
|
||||
<!-- Generated by Doxygen 1.13.1 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
@@ -118,7 +118,7 @@ $(function(){initNavTree('functions_vars.html',''); initResizable(true); });
|
||||
<!-- 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>
|
||||
<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.13.1 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
+16
-13
@@ -3,7 +3,7 @@
|
||||
<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="generator" content="Doxygen 1.13.1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>mi-malloc: Aligned Allocation</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.11.0 -->
|
||||
<!-- Generated by Doxygen 1.13.1 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
@@ -109,11 +109,14 @@ $(function(){initNavTree('group__aligned.html',''); initResizable(true); });
|
||||
<div class="headertitle"><div class="title">Aligned Allocation</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>Allocating aligned memory blocks.
|
||||
<a href="#details">More...</a></p>
|
||||
<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:ga69578ff1a98ca16e1dcd02c0995cd65c" id="r_ga69578ff1a98ca16e1dcd02c0995cd65c"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga69578ff1a98ca16e1dcd02c0995cd65c">mi_malloc_aligned</a> (size_t size, size_t alignment)</td></tr>
|
||||
<tr class="memdesc:ga69578ff1a98ca16e1dcd02c0995cd65c"><td class="mdescLeft"> </td><td class="mdescRight">Allocate <em>size</em> bytes aligned by <em>alignment</em>. <br /></td></tr>
|
||||
<tr class="memdesc:ga69578ff1a98ca16e1dcd02c0995cd65c"><td class="mdescLeft"> </td><td class="mdescRight">Allocate <em class="arg">size</em> bytes aligned by <em class="arg">alignment</em>. <br /></td></tr>
|
||||
<tr class="separator:ga69578ff1a98ca16e1dcd02c0995cd65c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gaac7d0beb782f9b9ac31f47492b130f82" id="r_gaac7d0beb782f9b9ac31f47492b130f82"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#gaac7d0beb782f9b9ac31f47492b130f82">mi_zalloc_aligned</a> (size_t size, size_t alignment)</td></tr>
|
||||
<tr class="separator:gaac7d0beb782f9b9ac31f47492b130f82"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -122,7 +125,7 @@ Functions</h2></td></tr>
|
||||
<tr class="memitem:ga5d7a46d054b4d7abe9d8d2474add2edf" id="r_ga5d7a46d054b4d7abe9d8d2474add2edf"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga5d7a46d054b4d7abe9d8d2474add2edf">mi_realloc_aligned</a> (void *p, size_t newsize, size_t alignment)</td></tr>
|
||||
<tr class="separator:ga5d7a46d054b4d7abe9d8d2474add2edf"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga2022f71b95a7cd6cce1b6e07752ae8ca" id="r_ga2022f71b95a7cd6cce1b6e07752ae8ca"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga2022f71b95a7cd6cce1b6e07752ae8ca">mi_malloc_aligned_at</a> (size_t size, size_t alignment, size_t offset)</td></tr>
|
||||
<tr class="memdesc:ga2022f71b95a7cd6cce1b6e07752ae8ca"><td class="mdescLeft"> </td><td class="mdescRight">Allocate <em>size</em> bytes aligned by <em>alignment</em> at a specified <em>offset</em>. <br /></td></tr>
|
||||
<tr class="memdesc:ga2022f71b95a7cd6cce1b6e07752ae8ca"><td class="mdescLeft"> </td><td class="mdescRight">Allocate <em class="arg">size</em> bytes aligned by <em class="arg">alignment</em> at a specified <em class="arg">offset</em>. <br /></td></tr>
|
||||
<tr class="separator:ga2022f71b95a7cd6cce1b6e07752ae8ca"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga7c1778805ce50ebbf02ccbd5e39d5dba" id="r_ga7c1778805ce50ebbf02ccbd5e39d5dba"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga7c1778805ce50ebbf02ccbd5e39d5dba">mi_zalloc_aligned_at</a> (size_t size, size_t alignment, size_t offset)</td></tr>
|
||||
<tr class="separator:ga7c1778805ce50ebbf02ccbd5e39d5dba"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -132,7 +135,8 @@ Functions</h2></td></tr>
|
||||
<tr class="separator:gad06dcf2bb8faadb2c8ea61ee5d24bbf6"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<p>Allocating aligned memory blocks. Note that <code>alignment</code> always follows <code>size</code> for consistency with the unaligned allocation API, but unfortunately this differs from <code>posix_memalign</code> and <code>aligned_alloc</code> in the C library. </p>
|
||||
<p>Allocating aligned memory blocks. </p>
|
||||
<p>Note that <code>alignment</code> always follows <code>size</code> for consistency with the unaligned allocation API, but unfortunately this differs from <code>posix_memalign</code> and <code>aligned_alloc</code> in the C library. </p>
|
||||
<h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="ga424ef386fb1f9f8e0a86ab53f16eaaf1" name="ga424ef386fb1f9f8e0a86ab53f16eaaf1"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ga424ef386fb1f9f8e0a86ab53f16eaaf1">◆ </a></span>mi_calloc_aligned()</h2>
|
||||
@@ -210,16 +214,15 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Allocate <em>size</em> bytes aligned by <em>alignment</em>. </p>
|
||||
<p>Allocate <em class="arg">size</em> bytes aligned by <em class="arg">alignment</em>. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">size</td><td>number of bytes to allocate. </td></tr>
|
||||
<tr><td class="paramname">alignment</td><td>the minimal alignment of the allocated memory. <br />
|
||||
</td></tr>
|
||||
<tr><td class="paramname">alignment</td><td>the minimal alignment of the allocated memory. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the allocated memory or <em>NULL</em> if out of memory, or if the alignment is not a power of 2 (including 0). The <em>size</em> is unrestricted (and does not have to be an integral multiple of the <em>alignment</em>). The returned pointer is aligned by <em>alignment</em>, i.e. <code>(uintptr_t)p % alignment == 0</code>. Returns a unique pointer if called with <em>size</em> 0.</dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the allocated memory or <em class="arg">NULL</em> if out of memory, or if the alignment is not a power of 2 (including 0). The <em class="arg">size</em> is unrestricted (and does not have to be an integral multiple of the <em class="arg">alignment</em>). The returned pointer is aligned by <em class="arg">alignment</em>, i.e. <code>(uintptr_t)p % alignment == 0</code>. Returns a unique pointer if called with <em class="arg">size</em> 0.</dd></dl>
|
||||
<p>Note that <code>alignment</code> always follows <code>size</code> for consistency with the unaligned allocation API, but unfortunately this differs from <code>posix_memalign</code> and <code>aligned_alloc</code> in the C library.</p>
|
||||
<dl class="section see"><dt>See also</dt><dd><a href="https://en.cppreference.com/w/c/memory/aligned_alloc">aligned_alloc</a> (in the standard C11 library, with switched arguments!) </dd>
|
||||
<dd>
|
||||
@@ -257,16 +260,16 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Allocate <em>size</em> bytes aligned by <em>alignment</em> at a specified <em>offset</em>. </p>
|
||||
<p>Allocate <em class="arg">size</em> bytes aligned by <em class="arg">alignment</em> at a specified <em class="arg">offset</em>. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">size</td><td>number of bytes to allocate. </td></tr>
|
||||
<tr><td class="paramname">alignment</td><td>the minimal alignment of the allocated memory at <em>offset</em>. </td></tr>
|
||||
<tr><td class="paramname">alignment</td><td>the minimal alignment of the allocated memory at <em class="arg">offset</em>. </td></tr>
|
||||
<tr><td class="paramname">offset</td><td>the offset that should be aligned. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the allocated memory or <em>NULL</em> if out of memory, or if the alignment is not a power of 2 (including 0). The <em>size</em> is unrestricted (and does not have to be an integral multiple of the <em>alignment</em>). The returned pointer is aligned by <em>alignment</em>, i.e. <code>(uintptr_t)p % alignment == 0</code>. Returns a unique pointer if called with <em>size</em> 0.</dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the allocated memory or <em class="arg">NULL</em> if out of memory, or if the alignment is not a power of 2 (including 0). The <em class="arg">size</em> is unrestricted (and does not have to be an integral multiple of the <em class="arg">alignment</em>). The returned pointer is aligned by <em class="arg">alignment</em>, i.e. <code>(uintptr_t)p % alignment == 0</code>. Returns a unique pointer if called with <em class="arg">size</em> 0.</dd></dl>
|
||||
<dl class="section see"><dt>See also</dt><dd><a href="https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/aligned-offset-malloc?view=vs-2017">_aligned_offset_malloc</a> (on Windows) </dd></dl>
|
||||
|
||||
</div>
|
||||
@@ -380,7 +383,7 @@ Functions</h2></td></tr>
|
||||
<!-- 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>
|
||||
<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.13.1 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
+21
-18
@@ -3,7 +3,7 @@
|
||||
<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="generator" content="Doxygen 1.13.1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>mi-malloc: Heap Introspection</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.11.0 -->
|
||||
<!-- Generated by Doxygen 1.13.1 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
@@ -111,6 +111,9 @@ $(function(){initNavTree('group__analysis.html',''); initResizable(true); });
|
||||
<div class="headertitle"><div class="title">Heap Introspection</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>Inspect the heap at runtime.
|
||||
<a href="#details">More...</a></p>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
|
||||
Data Structures</h2></td></tr>
|
||||
@@ -189,7 +192,7 @@ size in bytes of a full block including padding and metadata. </td></tr>
|
||||
<td class="fieldname">
|
||||
heap_tag</td>
|
||||
<td class="fielddoc">
|
||||
heap tag associated with this area (see <em>mi_heap_new_ex</em>) </td></tr>
|
||||
heap tag associated with this area (see <em class="arg">mi_heap_new_ex</em>) </td></tr>
|
||||
<tr><td class="fieldtype">
|
||||
<a id="ae848a3e6840414891035423948ca0383" name="ae848a3e6840414891035423948ca0383"></a>size_t</td>
|
||||
<td class="fieldname">
|
||||
@@ -220,8 +223,8 @@ bytes in use by allocated blocks </td></tr>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Visitor function passed to <a class="el" href="#ga70c46687dc6e9dc98b232b02646f8bed" title="Visit all areas and blocks in a heap.">mi_heap_visit_blocks()</a> </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if ok, <em>false</em> to stop visiting (i.e. break)</dd></dl>
|
||||
<p>This function is always first called for every <em>area</em> with <em>block</em> as a <em>NULL</em> pointer. If <em>visit_all_blocks</em> was <em>true</em>, the function is then called for every allocated block in that area. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em class="arg">true</em> if ok, <em class="arg">false</em> to stop visiting (i.e. break)</dd></dl>
|
||||
<p>This function is always first called for every <em class="arg">area</em> with <em class="arg">block</em> as a <em class="arg">NULL</em> pointer. If <em class="arg">visit_all_blocks</em> was <em class="arg">true</em>, the function is then called for every allocated block in that area. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -263,15 +266,15 @@ bytes in use by allocated blocks </td></tr>
|
||||
<p>Visit all areas and blocks in abandoned heaps. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">subproc_id</td><td>The sub-process id associated with the abandonded heaps. </td></tr>
|
||||
<tr><td class="paramname">subproc_id</td><td>The sub-process id associated with the abandoned heaps. </td></tr>
|
||||
<tr><td class="paramname">heap_tag</td><td>Visit only abandoned memory with the specified heap tag, use -1 to visit all abandoned memory. </td></tr>
|
||||
<tr><td class="paramname">visit_blocks</td><td>If <em>true</em> visits all allocated blocks, otherwise <em>visitor</em> is only called for every heap area. </td></tr>
|
||||
<tr><td class="paramname">visitor</td><td>This function is called for every area in the heap (with <em>block</em> as <em>NULL</em>). If <em>visit_all_blocks</em> is <em>true</em>, <em>visitor</em> is also called for every allocated block in every area (with <code>block!=NULL</code>). return <em>false</em> from this function to stop visiting early. </td></tr>
|
||||
<tr><td class="paramname">arg</td><td>extra argument passed to the <em>visitor</em>. </td></tr>
|
||||
<tr><td class="paramname">visit_blocks</td><td>If <em class="arg">true</em> visits all allocated blocks, otherwise <em class="arg">visitor</em> is only called for every heap area. </td></tr>
|
||||
<tr><td class="paramname">visitor</td><td>This function is called for every area in the heap (with <em class="arg">block</em> as <em class="arg">NULL</em>). If <em class="arg">visit_all_blocks</em> is <em class="arg">true</em>, <em class="arg">visitor</em> is also called for every allocated block in every area (with <code>block!=NULL</code>). return <em class="arg">false</em> from this function to stop visiting early. </td></tr>
|
||||
<tr><td class="paramname">arg</td><td>extra argument passed to the <em class="arg">visitor</em>. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if all areas and blocks were visited.</dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em class="arg">true</em> if all areas and blocks were visited.</dd></dl>
|
||||
<p>Note: requires the option <code>mi_option_visit_abandoned</code> to be set at the start of the program. </p>
|
||||
|
||||
</div>
|
||||
@@ -298,7 +301,7 @@ bytes in use by allocated blocks </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if <em>p</em> points to a block in default heap of this thread.</dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em class="arg">true</em> if <em class="arg">p</em> points to a block in default heap of this thread.</dd></dl>
|
||||
<p>Note: expensive function, linear in the pages in the heap. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="#gaa862aa8ed8d57d84cae41fc1022d71af" title="Does a heap contain a pointer to a previously allocated block?">mi_heap_contains_block()</a> </dd>
|
||||
<dd>
|
||||
<a class="el" href="group__heap.html#ga14c667a6e2c5d28762d8cb7d4e057909" title="Get the default heap that is used for mi_malloc() et al.">mi_heap_get_default()</a> </dd></dl>
|
||||
@@ -332,7 +335,7 @@ bytes in use by allocated blocks </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if <em>p</em> points to a block in <em>heap</em>.</dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em class="arg">true</em> if <em class="arg">p</em> points to a block in <em class="arg">heap</em>.</dd></dl>
|
||||
<p>Note: expensive function, linear in the pages in the heap. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="#gaa862aa8ed8d57d84cae41fc1022d71af" title="Does a heap contain a pointer to a previously allocated block?">mi_heap_contains_block()</a> </dd>
|
||||
<dd>
|
||||
<a class="el" href="group__heap.html#ga14c667a6e2c5d28762d8cb7d4e057909" title="Get the default heap that is used for mi_malloc() et al.">mi_heap_get_default()</a> </dd></dl>
|
||||
@@ -366,7 +369,7 @@ bytes in use by allocated blocks </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if the block pointed to by <em>p</em> is in the <em>heap</em>. </dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em class="arg">true</em> if the block pointed to by <em class="arg">p</em> is in the <em class="arg">heap</em>. </dd></dl>
|
||||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="#ga0d67c1789faaa15ff366c024fcaf6377" title="Check safely if any pointer is part of a heap.">mi_heap_check_owned()</a> </dd></dl>
|
||||
|
||||
</div>
|
||||
@@ -404,13 +407,13 @@ bytes in use by allocated blocks </td></tr>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">heap</td><td>The heap to visit. </td></tr>
|
||||
<tr><td class="paramname">visit_all_blocks</td><td>If <em>true</em> visits all allocated blocks, otherwise <em>visitor</em> is only called for every heap area. </td></tr>
|
||||
<tr><td class="paramname">visitor</td><td>This function is called for every area in the heap (with <em>block</em> as <em>NULL</em>). If <em>visit_all_blocks</em> is <em>true</em>, <em>visitor</em> is also called for every allocated block in every area (with <code>block!=NULL</code>). return <em>false</em> from this function to stop visiting early. </td></tr>
|
||||
<tr><td class="paramname">arg</td><td>Extra argument passed to <em>visitor</em>. </td></tr>
|
||||
<tr><td class="paramname">visit_all_blocks</td><td>If <em class="arg">true</em> visits all allocated blocks, otherwise <em class="arg">visitor</em> is only called for every heap area. </td></tr>
|
||||
<tr><td class="paramname">visitor</td><td>This function is called for every area in the heap (with <em class="arg">block</em> as <em class="arg">NULL</em>). If <em class="arg">visit_all_blocks</em> is <em class="arg">true</em>, <em class="arg">visitor</em> is also called for every allocated block in every area (with <code>block!=NULL</code>). return <em class="arg">false</em> from this function to stop visiting early. </td></tr>
|
||||
<tr><td class="paramname">arg</td><td>Extra argument passed to <em class="arg">visitor</em>. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if all areas and blocks were visited. </dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em class="arg">true</em> if all areas and blocks were visited. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -419,7 +422,7 @@ bytes in use by allocated blocks </td></tr>
|
||||
<!-- 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>
|
||||
<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.13.1 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
+14
-11
@@ -3,7 +3,7 @@
|
||||
<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="generator" content="Doxygen 1.13.1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>mi-malloc: C++ wrappers</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.11.0 -->
|
||||
<!-- Generated by Doxygen 1.13.1 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
@@ -110,11 +110,14 @@ $(function(){initNavTree('group__cpp.html',''); initResizable(true); });
|
||||
<div class="headertitle"><div class="title">C++ wrappers</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p><code>mi_</code> prefixed implementations of various allocation functions that use C++ semantics on out-of-memory, generally calling <code>std::get_new_handler</code> and raising a <code>std::bad_alloc</code> exception on failure.
|
||||
<a href="#details">More...</a></p>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
|
||||
Data Structures</h2></td></tr>
|
||||
<tr class="memitem:structmi__stl__allocator" id="r_structmi__stl__allocator"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="#structmi__stl__allocator">mi_stl_allocator< T ></a></td></tr>
|
||||
<tr class="memdesc:structmi__stl__allocator"><td class="mdescLeft"> </td><td class="mdescRight"><em>std::allocator</em> implementation for mimalloc for use in STL containers. <a href="#structmi__stl__allocator">More...</a><br /></td></tr>
|
||||
<tr class="memdesc:structmi__stl__allocator"><td class="mdescLeft"> </td><td class="mdescRight"><em class="arg">std::allocator</em> implementation for mimalloc for use in STL containers. <a href="#structmi__stl__allocator">More...</a><br /></td></tr>
|
||||
<tr class="separator:structmi__stl__allocator"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
@@ -129,10 +132,10 @@ Functions</h2></td></tr>
|
||||
<tr class="memdesc:ga79c54da0b4b4ce9fcc11d2f6ef6675f8"><td class="mdescLeft"> </td><td class="mdescRight">like <a class="el" href="group__aligned.html#ga69578ff1a98ca16e1dcd02c0995cd65c" title="Allocate size bytes aligned by alignment.">mi_malloc_aligned()</a>, but when out of memory, use <code>std::get_new_handler</code> and raise <code>std::bad_alloc</code> exception on failure. <br /></td></tr>
|
||||
<tr class="separator:ga79c54da0b4b4ce9fcc11d2f6ef6675f8"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga5cb4f120d1f7296074256215aa9a9e54" id="r_ga5cb4f120d1f7296074256215aa9a9e54"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga5cb4f120d1f7296074256215aa9a9e54">mi_new_nothrow</a> (size_t n)</td></tr>
|
||||
<tr class="memdesc:ga5cb4f120d1f7296074256215aa9a9e54"><td class="mdescLeft"> </td><td class="mdescRight">like <code>mi_malloc</code>, but when out of memory, use <code>std::get_new_handler</code> but return <em>NULL</em> on failure. <br /></td></tr>
|
||||
<tr class="memdesc:ga5cb4f120d1f7296074256215aa9a9e54"><td class="mdescLeft"> </td><td class="mdescRight">like <code>mi_malloc</code>, but when out of memory, use <code>std::get_new_handler</code> but return <em class="arg">NULL</em> on failure. <br /></td></tr>
|
||||
<tr class="separator:ga5cb4f120d1f7296074256215aa9a9e54"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga92ae00b6dd64406c7e64557711ec04b7" id="r_ga92ae00b6dd64406c7e64557711ec04b7"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga92ae00b6dd64406c7e64557711ec04b7">mi_new_aligned_nothrow</a> (size_t n, size_t alignment)</td></tr>
|
||||
<tr class="memdesc:ga92ae00b6dd64406c7e64557711ec04b7"><td class="mdescLeft"> </td><td class="mdescRight">like <code>mi_malloc_aligned</code>, but when out of memory, use <code>std::get_new_handler</code> but return <em>NULL</em> on failure. <br /></td></tr>
|
||||
<tr class="memdesc:ga92ae00b6dd64406c7e64557711ec04b7"><td class="mdescLeft"> </td><td class="mdescRight">like <code>mi_malloc_aligned</code>, but when out of memory, use <code>std::get_new_handler</code> but return <em class="arg">NULL</em> on failure. <br /></td></tr>
|
||||
<tr class="separator:ga92ae00b6dd64406c7e64557711ec04b7"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga6867d89baf992728e0cc20a1f47db4d0" id="r_ga6867d89baf992728e0cc20a1f47db4d0"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga6867d89baf992728e0cc20a1f47db4d0">mi_new_realloc</a> (void *p, size_t newsize)</td></tr>
|
||||
<tr class="memdesc:ga6867d89baf992728e0cc20a1f47db4d0"><td class="mdescLeft"> </td><td class="mdescRight">like <a class="el" href="group__malloc.html#ga0621af6a5e3aa384e6a1b548958bf583" title="Re-allocate memory to newsize bytes.">mi_realloc()</a>, but when out of memory, use <code>std::get_new_handler</code> and raise <code>std::bad_alloc</code> exception on failure. <br /></td></tr>
|
||||
@@ -142,8 +145,8 @@ Functions</h2></td></tr>
|
||||
<tr class="separator:gaace912ce086682d56f3ce9f7638d9d67"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<p><code>mi_</code> prefixed implementations of various allocation functions that use C++ semantics on out-of-memory, generally calling <code>std::get_new_handler</code> and raising a <code>std::bad_alloc</code> exception on failure.</p>
|
||||
<p>Note: use the <code>mimalloc-new-delete.h</code> header to override the <em>new</em> and <em>delete</em> operators globally. The wrappers here are mostly for convenience for library writers that need to interface with mimalloc from C++. </p>
|
||||
<p><code>mi_</code> prefixed implementations of various allocation functions that use C++ semantics on out-of-memory, generally calling <code>std::get_new_handler</code> and raising a <code>std::bad_alloc</code> exception on failure. </p>
|
||||
<p>Note: use the <code>mimalloc-new-delete.h</code> header to override the <em class="arg">new</em> and <em class="arg">delete</em> operators globally. The wrappers here are mostly for convenience for library writers that need to interface with mimalloc from C++. </p>
|
||||
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
|
||||
<a name="structmi__stl__allocator" id="structmi__stl__allocator"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#structmi__stl__allocator">◆ </a></span>mi_stl_allocator</h2>
|
||||
@@ -157,7 +160,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<div class="textblock"><div class="compoundTemplParams">template<class T><br />
|
||||
struct mi_stl_allocator< T ></div><p><em>std::allocator</em> implementation for mimalloc for use in STL containers. </p>
|
||||
struct mi_stl_allocator< T ></div><p><em class="arg">std::allocator</em> implementation for mimalloc for use in STL containers. </p>
|
||||
<p>For example: </p><div class="fragment"><div class="line">std::vector<int, mi_stl_allocator<int> > vec;</div>
|
||||
<div class="line">vec.push_back(1);</div>
|
||||
<div class="line">vec.pop_back();</div>
|
||||
@@ -226,7 +229,7 @@ struct mi_stl_allocator< T ></div><p><em>std::allocator</em> implementatio
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>like <code>mi_malloc_aligned</code>, but when out of memory, use <code>std::get_new_handler</code> but return <em>NULL</em> on failure. </p>
|
||||
<p>like <code>mi_malloc_aligned</code>, but when out of memory, use <code>std::get_new_handler</code> but return <em class="arg">NULL</em> on failure. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -268,7 +271,7 @@ struct mi_stl_allocator< T ></div><p><em>std::allocator</em> implementatio
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>like <code>mi_malloc</code>, but when out of memory, use <code>std::get_new_handler</code> but return <em>NULL</em> on failure. </p>
|
||||
<p>like <code>mi_malloc</code>, but when out of memory, use <code>std::get_new_handler</code> but return <em class="arg">NULL</em> on failure. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -328,7 +331,7 @@ struct mi_stl_allocator< T ></div><p><em>std::allocator</em> implementatio
|
||||
<!-- 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>
|
||||
<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.13.1 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
+42
-42
@@ -3,7 +3,7 @@
|
||||
<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="generator" content="Doxygen 1.13.1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>mi-malloc: Extended Functions</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.11.0 -->
|
||||
<!-- Generated by Doxygen 1.13.1 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
@@ -196,13 +196,13 @@ Functions</h2></td></tr>
|
||||
<tr class="memdesc:ga4c6486a1fdcd7a423b5f25fe4be8e0cf"><td class="mdescLeft"> </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"> </td></tr>
|
||||
<tr class="memitem:ga3132f521fb756fc0e8ec0b74fb58df50" id="r_ga3132f521fb756fc0e8ec0b74fb58df50"><td class="memItemLeft" align="right" valign="top">int </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"> </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="memdesc:ga3132f521fb756fc0e8ec0b74fb58df50"><td class="mdescLeft"> </td><td class="mdescRight">Reserve <em class="arg">pages</em> of huge OS pages (1GiB) evenly divided over <em class="arg">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"> </td></tr>
|
||||
<tr class="memitem:ga7795a13d20087447281858d2c771cca1" id="r_ga7795a13d20087447281858d2c771cca1"><td class="memItemLeft" align="right" valign="top">int </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"> </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="memdesc:ga7795a13d20087447281858d2c771cca1"><td class="mdescLeft"> </td><td class="mdescRight">Reserve <em class="arg">pages</em> of huge OS pages (1GiB) at a specific <em class="arg">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"> </td></tr>
|
||||
<tr class="memitem:gaad25050b19f30cd79397b227e0157a3f" id="r_gaad25050b19f30cd79397b227e0157a3f"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#gaad25050b19f30cd79397b227e0157a3f">mi_is_redirected</a> ()</td></tr>
|
||||
<tr class="memdesc:gaad25050b19f30cd79397b227e0157a3f"><td class="mdescLeft"> </td><td class="mdescRight">Is the C runtime <em>malloc</em> API redirected? <br /></td></tr>
|
||||
<tr class="memdesc:gaad25050b19f30cd79397b227e0157a3f"><td class="mdescLeft"> </td><td class="mdescRight">Is the C runtime <em class="arg">malloc</em> API redirected? <br /></td></tr>
|
||||
<tr class="separator:gaad25050b19f30cd79397b227e0157a3f"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga7d862c2affd5790381da14eb102a364d" id="r_ga7d862c2affd5790381da14eb102a364d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga7d862c2affd5790381da14eb102a364d">mi_process_info</a> (size_t *elapsed_msecs, size_t *user_msecs, size_t *system_msecs, size_t *current_rss, size_t *peak_rss, size_t *current_commit, size_t *peak_commit, size_t *page_faults)</td></tr>
|
||||
<tr class="memdesc:ga7d862c2affd5790381da14eb102a364d"><td class="mdescLeft"> </td><td class="mdescRight">Return process information (time and memory usage). <br /></td></tr>
|
||||
@@ -293,7 +293,7 @@ Functions</h2></td></tr>
|
||||
<p>Type of deferred free functions. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">force</td><td>If <em>true</em> all outstanding items should be freed. </td></tr>
|
||||
<tr><td class="paramname">force</td><td>If <em class="arg">true</em> all outstanding items should be freed. </td></tr>
|
||||
<tr><td class="paramname">heartbeat</td><td>A monotonically increasing count. </td></tr>
|
||||
<tr><td class="paramname">arg</td><td>Argument that was passed at registration to hold extra state.</td></tr>
|
||||
</table>
|
||||
@@ -418,7 +418,7 @@ Functions</h2></td></tr>
|
||||
<p>Eagerly free memory. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">force</td><td>If <em>true</em>, aggressively return memory to the OS (can be expensive!)</td></tr>
|
||||
<tr><td class="paramname">force</td><td>If <em class="arg">true</em>, aggressively return memory to the OS (can be expensive!)</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -518,13 +518,13 @@ Functions</h2></td></tr>
|
||||
<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">allow_destroy</td><td>Is <em class="arg">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>
|
||||
<p>The <em class="arg">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 class="arg">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>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -576,7 +576,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if this is a pointer into our heap. This function is relatively fast. </dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em class="arg">true</em> if this is a pointer into our heap. This function is relatively fast. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -595,8 +595,8 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Is the C runtime <em>malloc</em> API redirected? </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em>true</em> if all malloc API calls are redirected to mimalloc.</dd></dl>
|
||||
<p>Is the C runtime <em class="arg">malloc</em> API redirected? </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em class="arg">true</em> if all malloc API calls are redirected to mimalloc.</dd></dl>
|
||||
<p>Currently only used on Windows. </p>
|
||||
|
||||
</div>
|
||||
@@ -623,7 +623,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a pointer to newly allocated memory of at least <em>size</em> bytes, or <em>NULL</em> if out of memory. This function is meant for use in run-time systems for best performance and does not check if <em>size</em> was indeed small – use with care! </dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a pointer to newly allocated memory of at least <em class="arg">size</em> bytes, or <em class="arg">NULL</em> if out of memory. This function is meant for use in run-time systems for best performance and does not check if <em class="arg">size</em> was indeed small – use with care! </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -672,13 +672,13 @@ Functions</h2></td></tr>
|
||||
<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_large</td><td>Does it consist of large OS pages? Set this to <em class="arg">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>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em class="arg">true</em> if successful, and <em class="arg">false</em> on error. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -812,7 +812,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<p>The <em>current_rss</em> is precise on Windows and MacOSX; other systems estimate this using <em>current_commit</em>. The <em>commit</em> is precise on Windows but estimated on other systems as the amount of read/write accessible memory reserved by mimalloc. </p>
|
||||
<p>The <em class="arg">current_rss</em> is precise on Windows and MacOSX; other systems estimate this using <em class="arg">current_commit</em>. The <em class="arg">commit</em> is precise on Windows but estimated on other systems as the amount of read/write accessible memory reserved by mimalloc. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -838,12 +838,12 @@ Functions</h2></td></tr>
|
||||
<p>Register a deferred free function. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">deferred_free</td><td>Address of a deferred free-ing function or <em>NULL</em> to unregister. </td></tr>
|
||||
<tr><td class="paramname">deferred_free</td><td>Address of a deferred free-ing function or <em class="arg">NULL</em> to unregister. </td></tr>
|
||||
<tr><td class="paramname">arg</td><td>Argument that will be passed on to the deferred free function.</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<p>Some runtime systems use deferred free-ing, for example when using reference counting to limit the worst case free time. Such systems can register (re-entrant) deferred free function to free more memory on demand. When the <em>force</em> parameter is <em>true</em> all possible memory should be freed. The per-thread <em>heartbeat</em> parameter is monotonically increasing and guaranteed to be deterministic if the program allocates deterministically. The <em>deferred_free</em> function is guaranteed to be called deterministically after some number of allocations (regardless of freeing or available free memory). At most one <em>deferred_free</em> function can be active. </p>
|
||||
<p>Some runtime systems use deferred free-ing, for example when using reference counting to limit the worst case free time. Such systems can register (re-entrant) deferred free function to free more memory on demand. When the <em class="arg">force</em> parameter is <em class="arg">true</em> all possible memory should be freed. The per-thread <em class="arg">heartbeat</em> parameter is monotonically increasing and guaranteed to be deterministic if the program allocates deterministically. The <em class="arg">deferred_free</em> function is guaranteed to be called deterministically after some number of allocations (regardless of freeing or available free memory). At most one <em class="arg">deferred_free</em> function can be active. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -869,17 +869,17 @@ Functions</h2></td></tr>
|
||||
<p>Register an error callback function. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">errfun</td><td>The error function that is called on an error (use <em>NULL</em> for default) </td></tr>
|
||||
<tr><td class="paramname">errfun</td><td>The error function that is called on an error (use <em class="arg">NULL</em> for default) </td></tr>
|
||||
<tr><td class="paramname">arg</td><td>Extra argument that will be passed on to the error function.</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<p>The <em>errfun</em> function is called on an error in mimalloc after emitting an error message (through the output function). It as always legal to just return from the <em>errfun</em> function in which case allocation functions generally return <em>NULL</em> or ignore the condition. The default function only calls abort() when compiled in secure mode with an <em>EFAULT</em> error. The possible error codes are:</p><ul>
|
||||
<li><em>EAGAIN:</em> Double free was detected (only in debug and secure mode).</li>
|
||||
<li><em>EFAULT:</em> Corrupted free list or meta-data was detected (only in debug and secure mode).</li>
|
||||
<li><em>ENOMEM:</em> Not enough memory available to satisfy the request.</li>
|
||||
<li><em>EOVERFLOW:</em> Too large a request, for example in <a class="el" href="group__malloc.html#ga6686568014b54d1e6c7ac64a076e4f56" title="Allocate zero-initialized count elements of size bytes.">mi_calloc()</a>, the <em>count</em> and <em>size</em> parameters are too large.</li>
|
||||
<li><em>EINVAL:</em> Trying to free or re-allocate an invalid pointer. </li>
|
||||
<p>The <em class="arg">errfun</em> function is called on an error in mimalloc after emitting an error message (through the output function). It as always legal to just return from the <em class="arg">errfun</em> function in which case allocation functions generally return <em class="arg">NULL</em> or ignore the condition. The default function only calls abort() when compiled in secure mode with an <em class="arg">EFAULT</em> error. The possible error codes are:</p><ul>
|
||||
<li><em class="arg">EAGAIN:</em> Double free was detected (only in debug and secure mode).</li>
|
||||
<li><em class="arg">EFAULT:</em> Corrupted free list or meta-data was detected (only in debug and secure mode).</li>
|
||||
<li><em class="arg">ENOMEM:</em> Not enough memory available to satisfy the request.</li>
|
||||
<li><em class="arg">EOVERFLOW:</em> Too large a request, for example in <a class="el" href="group__malloc.html#ga6686568014b54d1e6c7ac64a076e4f56" title="Allocate zero-initialized count elements of size bytes.">mi_calloc()</a>, the <em class="arg">count</em> and <em class="arg">size</em> parameters are too large.</li>
|
||||
<li><em class="arg">EINVAL:</em> Trying to free or re-allocate an invalid pointer. </li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@@ -939,7 +939,7 @@ Functions</h2></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>
|
||||
<p>Reserve <em class="arg">pages</em> of huge OS pages (1GiB) at a specific <em class="arg">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>
|
||||
@@ -948,8 +948,8 @@ Functions</h2></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>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 if successful, <em class="arg">ENOMEM</em> if running out of memory, or <em class="arg">ETIMEDOUT</em> if timed out.</dd></dl>
|
||||
<p>The reserved memory is used by mimalloc to satisfy allocations. May quit before <em class="arg">timeout_msecs</em> are expired if it estimates it will take more than 1.5 times <em class="arg">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>
|
||||
@@ -998,7 +998,7 @@ Functions</h2></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>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 if successful, <em class="arg">ENOMEM</em> if running out of memory, or <em class="arg">ETIMEDOUT</em> if timed out. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -1026,7 +1026,7 @@ Functions</h2></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>
|
||||
<p>Reserve <em class="arg">pages</em> of huge OS pages (1GiB) evenly divided over <em class="arg">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>
|
||||
@@ -1035,8 +1035,8 @@ Functions</h2></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>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 if successful, <em class="arg">ENOMEM</em> if running out of memory, or <em class="arg">ETIMEDOUT</em> if timed out.</dd></dl>
|
||||
<p>The reserved memory is used by mimalloc to satisfy allocations. May quit before <em class="arg">timeout_msecs</em> are expired if it estimates it will take more than 1.5 times <em class="arg">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>
|
||||
@@ -1073,7 +1073,7 @@ Functions</h2></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>
|
||||
<dl class="section return"><dt>Returns</dt><dd><em class="arg">0</em> if successful, and an error code otherwise (e.g. <code>ENOMEM</code>). </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -1193,8 +1193,8 @@ Functions</h2></td></tr>
|
||||
<p>Print the main statistics. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">out</td><td>An output function or <em>NULL</em> for the default. </td></tr>
|
||||
<tr><td class="paramname">arg</td><td>Optional argument passed to <em>out</em> (if not <em>NULL</em>)</td></tr>
|
||||
<tr><td class="paramname">out</td><td>An output function or <em class="arg">NULL</em> for the default. </td></tr>
|
||||
<tr><td class="paramname">arg</td><td>Optional argument passed to <em class="arg">out</em> (if not <em class="arg">NULL</em>)</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1367,8 +1367,8 @@ Functions</h2></td></tr>
|
||||
<p>Print out heap statistics for this thread. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">out</td><td>An output function or <em>NULL</em> for the default. </td></tr>
|
||||
<tr><td class="paramname">arg</td><td>Optional argument passed to <em>out</em> (if not <em>NULL</em>)</td></tr>
|
||||
<tr><td class="paramname">out</td><td>An output function or <em class="arg">NULL</em> for the default. </td></tr>
|
||||
<tr><td class="paramname">arg</td><td>Optional argument passed to <em class="arg">out</em> (if not <em class="arg">NULL</em>)</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1394,12 +1394,12 @@ Functions</h2></td></tr>
|
||||
<p>Return the available bytes in a memory block. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">p</td><td>Pointer to previously allocated memory (or <em>NULL</em>) </td></tr>
|
||||
<tr><td class="paramname">p</td><td>Pointer to previously allocated memory (or <em class="arg">NULL</em>) </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Returns the available bytes in the memory block, or 0 if <em>p</em> was <em>NULL</em>.</dd></dl>
|
||||
<p>The returned size can be used to call <em>mi_expand</em> successfully. The returned size is always at least equal to the allocated size of <em>p</em>.</p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Returns the available bytes in the memory block, or 0 if <em class="arg">p</em> was <em class="arg">NULL</em>.</dd></dl>
|
||||
<p>The returned size can be used to call <em class="arg">mi_expand</em> successfully. The returned size is always at least equal to the allocated size of <em class="arg">p</em>.</p>
|
||||
<dl class="section see"><dt>See also</dt><dd><a href="https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/msize?view=vs-2017">_msize</a> (Windows) </dd>
|
||||
<dd>
|
||||
<a href="http://man7.org/linux/man-pages/man3/malloc_usable_size.3.html">malloc_usable_size</a> (Linux) </dd>
|
||||
@@ -1430,7 +1430,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a pointer to newly allocated zero-initialized memory of at least <em>size</em> bytes, or <em>NULL</em> if out of memory. This function is meant for use in run-time systems for best performance and does not check if <em>size</em> was indeed small – use with care! </dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a pointer to newly allocated zero-initialized memory of at least <em class="arg">size</em> bytes, or <em class="arg">NULL</em> if out of memory. This function is meant for use in run-time systems for best performance and does not check if <em class="arg">size</em> was indeed small – use with care! </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -1439,7 +1439,7 @@ Functions</h2></td></tr>
|
||||
<!-- 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>
|
||||
<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.13.1 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
+17
-14
@@ -3,7 +3,7 @@
|
||||
<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="generator" content="Doxygen 1.13.1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>mi-malloc: Heap Allocation</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.11.0 -->
|
||||
<!-- Generated by Doxygen 1.13.1 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
@@ -110,6 +110,9 @@ $(function(){initNavTree('group__heap.html',''); initResizable(true); });
|
||||
<div class="headertitle"><div class="title">Heap Allocation</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>First-class heaps that can be destroyed in one go.
|
||||
<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>
|
||||
@@ -150,19 +153,19 @@ Functions</h2></td></tr>
|
||||
<tr class="memdesc:gabebc796399619d964d8db77aa835e8c1"><td class="mdescLeft"> </td><td class="mdescRight">Allocate zero-initialized in a specific heap. <br /></td></tr>
|
||||
<tr class="separator:gabebc796399619d964d8db77aa835e8c1"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gac0098aaf231d3e9586c73136d5df95da" id="r_gac0098aaf231d3e9586c73136d5df95da"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#gac0098aaf231d3e9586c73136d5df95da">mi_heap_calloc</a> (<a class="el" href="#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> *heap, size_t count, size_t size)</td></tr>
|
||||
<tr class="memdesc:gac0098aaf231d3e9586c73136d5df95da"><td class="mdescLeft"> </td><td class="mdescRight">Allocate <em>count</em> zero-initialized elements in a specific heap. <br /></td></tr>
|
||||
<tr class="memdesc:gac0098aaf231d3e9586c73136d5df95da"><td class="mdescLeft"> </td><td class="mdescRight">Allocate <em class="arg">count</em> zero-initialized elements in a specific heap. <br /></td></tr>
|
||||
<tr class="separator:gac0098aaf231d3e9586c73136d5df95da"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gab0f755c0b21c387fe8e9024200faa372" id="r_gab0f755c0b21c387fe8e9024200faa372"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#gab0f755c0b21c387fe8e9024200faa372">mi_heap_mallocn</a> (<a class="el" href="#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> *heap, size_t count, size_t size)</td></tr>
|
||||
<tr class="memdesc:gab0f755c0b21c387fe8e9024200faa372"><td class="mdescLeft"> </td><td class="mdescRight">Allocate <em>count</em> elements in a specific heap. <br /></td></tr>
|
||||
<tr class="memdesc:gab0f755c0b21c387fe8e9024200faa372"><td class="mdescLeft"> </td><td class="mdescRight">Allocate <em class="arg">count</em> elements in a specific heap. <br /></td></tr>
|
||||
<tr class="separator:gab0f755c0b21c387fe8e9024200faa372"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga5754e09ccc51dd6bc73885bb6ea21b7a" id="r_ga5754e09ccc51dd6bc73885bb6ea21b7a"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga5754e09ccc51dd6bc73885bb6ea21b7a">mi_heap_strdup</a> (<a class="el" href="#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> *heap, const char *s)</td></tr>
|
||||
<tr class="memdesc:ga5754e09ccc51dd6bc73885bb6ea21b7a"><td class="mdescLeft"> </td><td class="mdescRight">Duplicate a string in a specific heap. <br /></td></tr>
|
||||
<tr class="separator:ga5754e09ccc51dd6bc73885bb6ea21b7a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gad224df78f1fbee942df8adf023e12cf3" id="r_gad224df78f1fbee942df8adf023e12cf3"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="#gad224df78f1fbee942df8adf023e12cf3">mi_heap_strndup</a> (<a class="el" href="#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> *heap, const char *s, size_t n)</td></tr>
|
||||
<tr class="memdesc:gad224df78f1fbee942df8adf023e12cf3"><td class="mdescLeft"> </td><td class="mdescRight">Duplicate a string of at most length <em>n</em> in a specific heap. <br /></td></tr>
|
||||
<tr class="memdesc:gad224df78f1fbee942df8adf023e12cf3"><td class="mdescLeft"> </td><td class="mdescRight">Duplicate a string of at most length <em class="arg">n</em> in a specific heap. <br /></td></tr>
|
||||
<tr class="separator:gad224df78f1fbee942df8adf023e12cf3"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga55545a3ec6da29c5b4f62e540ecac1e2" id="r_ga55545a3ec6da29c5b4f62e540ecac1e2"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga55545a3ec6da29c5b4f62e540ecac1e2">mi_heap_realpath</a> (<a class="el" href="#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> *heap, const char *fname, char *resolved_name)</td></tr>
|
||||
<tr class="memdesc:ga55545a3ec6da29c5b4f62e540ecac1e2"><td class="mdescLeft"> </td><td class="mdescRight">Resolve a file path name using a specific <em>heap</em> to allocate the result. <br /></td></tr>
|
||||
<tr class="memdesc:ga55545a3ec6da29c5b4f62e540ecac1e2"><td class="mdescLeft"> </td><td class="mdescRight">Resolve a file path name using a specific <em class="arg">heap</em> to allocate the result. <br /></td></tr>
|
||||
<tr class="separator:ga55545a3ec6da29c5b4f62e540ecac1e2"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gac5252d6a2e510bd349e4fcb452e6a93a" id="r_gac5252d6a2e510bd349e4fcb452e6a93a"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#gac5252d6a2e510bd349e4fcb452e6a93a">mi_heap_realloc</a> (<a class="el" href="#ga34a47cde5a5b38c29f1aa3c5e76943c2">mi_heap_t</a> *heap, void *p, size_t newsize)</td></tr>
|
||||
<tr class="separator:gac5252d6a2e510bd349e4fcb452e6a93a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -232,7 +235,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Allocate <em>count</em> zero-initialized elements in a specific heap. </p>
|
||||
<p>Allocate <em class="arg">count</em> zero-initialized elements in a specific heap. </p>
|
||||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__malloc.html#ga6686568014b54d1e6c7ac64a076e4f56" title="Allocate zero-initialized count elements of size bytes.">mi_calloc()</a> </dd></dl>
|
||||
|
||||
</div>
|
||||
@@ -344,7 +347,7 @@ Functions</h2></td></tr>
|
||||
|
||||
<p>Delete a previously allocated heap. </p>
|
||||
<p>This will release resources and migrate any still allocated blocks in this heap (efficiently) to the default heap.</p>
|
||||
<p>If <em>heap</em> is the default heap, the default heap is set to the backing heap. </p>
|
||||
<p>If <em class="arg">heap</em> is the default heap, the default heap is set to the backing heap. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -365,7 +368,7 @@ Functions</h2></td></tr>
|
||||
|
||||
<p>Destroy a heap, freeing all its still allocated blocks. </p>
|
||||
<p>Use with care as this will free all blocks still allocated in the heap. However, this can be a very efficient way to free all heap memory in one go.</p>
|
||||
<p>If <em>heap</em> is the default heap, the default heap is set to the backing heap. </p>
|
||||
<p>If <em class="arg">heap</em> is the default heap, the default heap is set to the backing heap. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -510,7 +513,7 @@ Functions</h2></td></tr>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Allocate a small object in a specific heap. </p>
|
||||
<p><em>size</em> must be smaller or equal to <a class="el" href="group__extended.html#ga1ea64283508718d9d645c38efc2f4305" title="Maximum size allowed for small allocations in mi_malloc_small and mi_zalloc_small (usually 128*sizeof...">MI_SMALL_SIZE_MAX()</a>. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__malloc.html#gae1dd97b542420c87ae085e822b1229e8" title="Allocate size bytes.">mi_malloc()</a> </dd></dl>
|
||||
<p><em class="arg">size</em> must be smaller or equal to <a class="el" href="group__extended.html#ga1ea64283508718d9d645c38efc2f4305" title="Maximum size allowed for small allocations in mi_malloc_small and mi_zalloc_small (usually 128*sizeof...">MI_SMALL_SIZE_MAX()</a>. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__malloc.html#gae1dd97b542420c87ae085e822b1229e8" title="Allocate size bytes.">mi_malloc()</a> </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -538,7 +541,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Allocate <em>count</em> elements in a specific heap. </p>
|
||||
<p>Allocate <em class="arg">count</em> elements in a specific heap. </p>
|
||||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__malloc.html#ga61f46bade3db76ca24aaafedc40de7b6" title="Allocate count elements of size bytes.">mi_mallocn()</a> </dd></dl>
|
||||
|
||||
</div>
|
||||
@@ -736,7 +739,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Resolve a file path name using a specific <em>heap</em> to allocate the result. </p>
|
||||
<p>Resolve a file path name using a specific <em class="arg">heap</em> to allocate the result. </p>
|
||||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__malloc.html#ga94c3afcc086e85d75a57e9f76b9b71dd" title="Resolve a file path name.">mi_realpath()</a> </dd></dl>
|
||||
|
||||
</div>
|
||||
@@ -815,7 +818,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Duplicate a string of at most length <em>n</em> in a specific heap. </p>
|
||||
<p>Duplicate a string of at most length <em class="arg">n</em> in a specific heap. </p>
|
||||
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__malloc.html#ga486d0d26b3b3794f6d1cdb41a9aed92d" title="Allocate and duplicate a string up to n bytes.">mi_strndup()</a> </dd></dl>
|
||||
|
||||
</div>
|
||||
@@ -906,7 +909,7 @@ Functions</h2></td></tr>
|
||||
<!-- 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>
|
||||
<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.13.1 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
+47
-47
@@ -3,7 +3,7 @@
|
||||
<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="generator" content="Doxygen 1.13.1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>mi-malloc: Basic Allocation</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.11.0 -->
|
||||
<!-- Generated by Doxygen 1.13.1 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
@@ -119,37 +119,37 @@ Functions</h2></td></tr>
|
||||
<tr class="memdesc:gaf2c7b89c327d1f60f59e68b9ea644d95"><td class="mdescLeft"> </td><td class="mdescRight">Free previously allocated memory. <br /></td></tr>
|
||||
<tr class="separator:gaf2c7b89c327d1f60f59e68b9ea644d95"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gae1dd97b542420c87ae085e822b1229e8" id="r_gae1dd97b542420c87ae085e822b1229e8"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#gae1dd97b542420c87ae085e822b1229e8">mi_malloc</a> (size_t size)</td></tr>
|
||||
<tr class="memdesc:gae1dd97b542420c87ae085e822b1229e8"><td class="mdescLeft"> </td><td class="mdescRight">Allocate <em>size</em> bytes. <br /></td></tr>
|
||||
<tr class="memdesc:gae1dd97b542420c87ae085e822b1229e8"><td class="mdescLeft"> </td><td class="mdescRight">Allocate <em class="arg">size</em> bytes. <br /></td></tr>
|
||||
<tr class="separator:gae1dd97b542420c87ae085e822b1229e8"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gae6e38c4403247a7b40d80419e093bfb8" id="r_gae6e38c4403247a7b40d80419e093bfb8"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#gae6e38c4403247a7b40d80419e093bfb8">mi_zalloc</a> (size_t size)</td></tr>
|
||||
<tr class="memdesc:gae6e38c4403247a7b40d80419e093bfb8"><td class="mdescLeft"> </td><td class="mdescRight">Allocate zero-initialized <code>size</code> bytes. <br /></td></tr>
|
||||
<tr class="separator:gae6e38c4403247a7b40d80419e093bfb8"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga6686568014b54d1e6c7ac64a076e4f56" id="r_ga6686568014b54d1e6c7ac64a076e4f56"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga6686568014b54d1e6c7ac64a076e4f56">mi_calloc</a> (size_t count, size_t size)</td></tr>
|
||||
<tr class="memdesc:ga6686568014b54d1e6c7ac64a076e4f56"><td class="mdescLeft"> </td><td class="mdescRight">Allocate zero-initialized <em>count</em> elements of <em>size</em> bytes. <br /></td></tr>
|
||||
<tr class="memdesc:ga6686568014b54d1e6c7ac64a076e4f56"><td class="mdescLeft"> </td><td class="mdescRight">Allocate zero-initialized <em class="arg">count</em> elements of <em class="arg">size</em> bytes. <br /></td></tr>
|
||||
<tr class="separator:ga6686568014b54d1e6c7ac64a076e4f56"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga0621af6a5e3aa384e6a1b548958bf583" id="r_ga0621af6a5e3aa384e6a1b548958bf583"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga0621af6a5e3aa384e6a1b548958bf583">mi_realloc</a> (void *p, size_t newsize)</td></tr>
|
||||
<tr class="memdesc:ga0621af6a5e3aa384e6a1b548958bf583"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em>newsize</em> bytes. <br /></td></tr>
|
||||
<tr class="memdesc:ga0621af6a5e3aa384e6a1b548958bf583"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em class="arg">newsize</em> bytes. <br /></td></tr>
|
||||
<tr class="separator:ga0621af6a5e3aa384e6a1b548958bf583"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga23a0fbb452b5dce8e31fab1a1958cacc" id="r_ga23a0fbb452b5dce8e31fab1a1958cacc"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga23a0fbb452b5dce8e31fab1a1958cacc">mi_recalloc</a> (void *p, size_t count, size_t size)</td></tr>
|
||||
<tr class="memdesc:ga23a0fbb452b5dce8e31fab1a1958cacc"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em>count</em> elements of <em>size</em> bytes, with extra memory initialized to zero. <br /></td></tr>
|
||||
<tr class="memdesc:ga23a0fbb452b5dce8e31fab1a1958cacc"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em class="arg">count</em> elements of <em class="arg">size</em> bytes, with extra memory initialized to zero. <br /></td></tr>
|
||||
<tr class="separator:ga23a0fbb452b5dce8e31fab1a1958cacc"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga19299856216cfbb08e2628593654dfb0" id="r_ga19299856216cfbb08e2628593654dfb0"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga19299856216cfbb08e2628593654dfb0">mi_expand</a> (void *p, size_t newsize)</td></tr>
|
||||
<tr class="memdesc:ga19299856216cfbb08e2628593654dfb0"><td class="mdescLeft"> </td><td class="mdescRight">Try to re-allocate memory to <em>newsize</em> bytes <em>in place</em>. <br /></td></tr>
|
||||
<tr class="memdesc:ga19299856216cfbb08e2628593654dfb0"><td class="mdescLeft"> </td><td class="mdescRight">Try to re-allocate memory to <em class="arg">newsize</em> bytes <em>in place</em>. <br /></td></tr>
|
||||
<tr class="separator:ga19299856216cfbb08e2628593654dfb0"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga61f46bade3db76ca24aaafedc40de7b6" id="r_ga61f46bade3db76ca24aaafedc40de7b6"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga61f46bade3db76ca24aaafedc40de7b6">mi_mallocn</a> (size_t count, size_t size)</td></tr>
|
||||
<tr class="memdesc:ga61f46bade3db76ca24aaafedc40de7b6"><td class="mdescLeft"> </td><td class="mdescRight">Allocate <em>count</em> elements of <em>size</em> bytes. <br /></td></tr>
|
||||
<tr class="memdesc:ga61f46bade3db76ca24aaafedc40de7b6"><td class="mdescLeft"> </td><td class="mdescRight">Allocate <em class="arg">count</em> elements of <em class="arg">size</em> bytes. <br /></td></tr>
|
||||
<tr class="separator:ga61f46bade3db76ca24aaafedc40de7b6"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga8bddfb4a1270a0854bbcf44cb3980467" id="r_ga8bddfb4a1270a0854bbcf44cb3980467"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga8bddfb4a1270a0854bbcf44cb3980467">mi_reallocn</a> (void *p, size_t count, size_t size)</td></tr>
|
||||
<tr class="memdesc:ga8bddfb4a1270a0854bbcf44cb3980467"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em>count</em> elements of <em>size</em> bytes. <br /></td></tr>
|
||||
<tr class="memdesc:ga8bddfb4a1270a0854bbcf44cb3980467"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em class="arg">count</em> elements of <em class="arg">size</em> bytes. <br /></td></tr>
|
||||
<tr class="separator:ga8bddfb4a1270a0854bbcf44cb3980467"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga4dc3a4067037b151a64629fe8a332641" id="r_ga4dc3a4067037b151a64629fe8a332641"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga4dc3a4067037b151a64629fe8a332641">mi_reallocf</a> (void *p, size_t newsize)</td></tr>
|
||||
<tr class="memdesc:ga4dc3a4067037b151a64629fe8a332641"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em>newsize</em> bytes,. <br /></td></tr>
|
||||
<tr class="memdesc:ga4dc3a4067037b151a64629fe8a332641"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocate memory to <em class="arg">newsize</em> bytes,. <br /></td></tr>
|
||||
<tr class="separator:ga4dc3a4067037b151a64629fe8a332641"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga245ac90ebc2cfdd17de599e5fea59889" id="r_ga245ac90ebc2cfdd17de599e5fea59889"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga245ac90ebc2cfdd17de599e5fea59889">mi_strdup</a> (const char *s)</td></tr>
|
||||
<tr class="memdesc:ga245ac90ebc2cfdd17de599e5fea59889"><td class="mdescLeft"> </td><td class="mdescRight">Allocate and duplicate a string. <br /></td></tr>
|
||||
<tr class="separator:ga245ac90ebc2cfdd17de599e5fea59889"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga486d0d26b3b3794f6d1cdb41a9aed92d" id="r_ga486d0d26b3b3794f6d1cdb41a9aed92d"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga486d0d26b3b3794f6d1cdb41a9aed92d">mi_strndup</a> (const char *s, size_t n)</td></tr>
|
||||
<tr class="memdesc:ga486d0d26b3b3794f6d1cdb41a9aed92d"><td class="mdescLeft"> </td><td class="mdescRight">Allocate and duplicate a string up to <em>n</em> bytes. <br /></td></tr>
|
||||
<tr class="memdesc:ga486d0d26b3b3794f6d1cdb41a9aed92d"><td class="mdescLeft"> </td><td class="mdescRight">Allocate and duplicate a string up to <em class="arg">n</em> bytes. <br /></td></tr>
|
||||
<tr class="separator:ga486d0d26b3b3794f6d1cdb41a9aed92d"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga94c3afcc086e85d75a57e9f76b9b71dd" id="r_ga94c3afcc086e85d75a57e9f76b9b71dd"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga94c3afcc086e85d75a57e9f76b9b71dd">mi_realpath</a> (const char *fname, char *resolved_name)</td></tr>
|
||||
<tr class="memdesc:ga94c3afcc086e85d75a57e9f76b9b71dd"><td class="mdescLeft"> </td><td class="mdescRight">Resolve a file path name. <br /></td></tr>
|
||||
@@ -177,7 +177,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Allocate zero-initialized <em>count</em> elements of <em>size</em> bytes. </p>
|
||||
<p>Allocate zero-initialized <em class="arg">count</em> elements of <em class="arg">size</em> bytes. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">count</td><td>number of elements. </td></tr>
|
||||
@@ -185,8 +185,8 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the allocated memory of <em>size*<em>count</em> bytes</em>, or <em>NULL</em> if either out of memory or when <code>count*size</code> overflows.</dd></dl>
|
||||
<p>Returns a unique pointer if called with either <em>size</em> or <em>count</em> of 0. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="#gae6e38c4403247a7b40d80419e093bfb8" title="Allocate zero-initialized size bytes.">mi_zalloc()</a> </dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the allocated memory of <em class="arg">size*<em class="arg">count</em> bytes</em>, or <em class="arg">NULL</em> if either out of memory or when <code>count*size</code> overflows.</dd></dl>
|
||||
<p>Returns a unique pointer if called with either <em class="arg">size</em> or <em class="arg">count</em> of 0. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="#gae6e38c4403247a7b40d80419e093bfb8" title="Allocate zero-initialized size bytes.">mi_zalloc()</a> </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -209,15 +209,15 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Try to re-allocate memory to <em>newsize</em> bytes <em>in place</em>. </p>
|
||||
<p>Try to re-allocate memory to <em class="arg">newsize</em> bytes <em>in place</em>. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">p</td><td>pointer to previously allocated memory (or <em>NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">p</td><td>pointer to previously allocated memory (or <em class="arg">NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">newsize</td><td>the new required size in bytes. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the re-allocated memory of <em>newsize</em> bytes (always equal to <em>p</em>), or <em>NULL</em> if either out of memory or if the memory could not be expanded in place. If <em>NULL</em> is returned, the pointer <em>p</em> is not freed. Otherwise the original pointer is returned as the reallocated result since it fits in-place with the new size. If <em>newsize</em> is larger than the original <em>size</em> allocated for <em>p</em>, the bytes after <em>size</em> are uninitialized. </dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the re-allocated memory of <em class="arg">newsize</em> bytes (always equal to <em class="arg">p</em>), or <em class="arg">NULL</em> if either out of memory or if the memory could not be expanded in place. If <em class="arg">NULL</em> is returned, the pointer <em class="arg">p</em> is not freed. Otherwise the original pointer is returned as the reallocated result since it fits in-place with the new size. If <em class="arg">newsize</em> is larger than the original <em class="arg">size</em> allocated for <em class="arg">p</em>, the bytes after <em class="arg">size</em> are uninitialized. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -237,9 +237,9 @@ Functions</h2></td></tr>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Free previously allocated memory. </p>
|
||||
<p>The pointer <code>p</code> must have been allocated before (or be <em>NULL</em>). </p><dl class="params"><dt>Parameters</dt><dd>
|
||||
<p>The pointer <code>p</code> must have been allocated before (or be <em class="arg">NULL</em>). </p><dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">p</td><td>pointer to free, or <em>NULL</em>. </td></tr>
|
||||
<tr><td class="paramname">p</td><td>pointer to free, or <em class="arg">NULL</em>. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -261,14 +261,14 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Allocate <em>size</em> bytes. </p>
|
||||
<p>Allocate <em class="arg">size</em> bytes. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">size</td><td>number of bytes to allocate. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the allocated memory or <em>NULL</em> if out of memory. Returns a unique pointer if called with <em>size</em> 0. </dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the allocated memory or <em class="arg">NULL</em> if out of memory. Returns a unique pointer if called with <em class="arg">size</em> 0. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -291,7 +291,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Allocate <em>count</em> elements of <em>size</em> bytes. </p>
|
||||
<p>Allocate <em class="arg">count</em> elements of <em class="arg">size</em> bytes. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">count</td><td>The number of elements. </td></tr>
|
||||
@@ -299,7 +299,7 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>A pointer to a block of <em>count</em> * <em>size</em> bytes, or <em>NULL</em> if out of memory or if <em>count</em> * <em>size</em> overflows.</dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>A pointer to a block of <em class="arg">count</em> * <em class="arg">size</em> bytes, or <em class="arg">NULL</em> if out of memory or if <em class="arg">count</em> * <em class="arg">size</em> overflows.</dd></dl>
|
||||
<p>If there is no overflow, it behaves exactly like <code>mi_malloc(count*size)</code>. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="#ga6686568014b54d1e6c7ac64a076e4f56" title="Allocate zero-initialized count elements of size bytes.">mi_calloc()</a> </dd>
|
||||
<dd>
|
||||
mi_zallocn() </dd></dl>
|
||||
@@ -325,15 +325,15 @@ mi_zallocn() </dd></dl>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Re-allocate memory to <em>newsize</em> bytes. </p>
|
||||
<p>Re-allocate memory to <em class="arg">newsize</em> bytes. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">p</td><td>pointer to previously allocated memory (or <em>NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">p</td><td>pointer to previously allocated memory (or <em class="arg">NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">newsize</td><td>the new required size in bytes. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the re-allocated memory of <em>newsize</em> bytes, or <em>NULL</em> if out of memory. If <em>NULL</em> is returned, the pointer <em>p</em> is not freed. Otherwise the original pointer is either freed or returned as the reallocated result (in case it fits in-place with the new size). If the pointer <em>p</em> is <em>NULL</em>, it behaves as <em>mi_malloc</em>(<em>newsize</em>). If <em>newsize</em> is larger than the original <em>size</em> allocated for <em>p</em>, the bytes after <em>size</em> are uninitialized. </dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the re-allocated memory of <em class="arg">newsize</em> bytes, or <em class="arg">NULL</em> if out of memory. If <em class="arg">NULL</em> is returned, the pointer <em class="arg">p</em> is not freed. Otherwise the original pointer is either freed or returned as the reallocated result (in case it fits in-place with the new size). If the pointer <em class="arg">p</em> is <em class="arg">NULL</em>, it behaves as <em class="arg">mi_malloc</em>(<em class="arg">newsize</em>). If <em class="arg">newsize</em> is larger than the original <em class="arg">size</em> allocated for <em class="arg">p</em>, the bytes after <em class="arg">size</em> are uninitialized. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -356,16 +356,16 @@ mi_zallocn() </dd></dl>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Re-allocate memory to <em>newsize</em> bytes,. </p>
|
||||
<p>Re-allocate memory to <em class="arg">newsize</em> bytes,. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">p</td><td>pointer to previously allocated memory (or <em>NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">p</td><td>pointer to previously allocated memory (or <em class="arg">NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">newsize</td><td>the new required size in bytes. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the re-allocated memory of <em>newsize</em> bytes, or <em>NULL</em> if out of memory.</dd></dl>
|
||||
<p>In contrast to <a class="el" href="#ga0621af6a5e3aa384e6a1b548958bf583" title="Re-allocate memory to newsize bytes.">mi_realloc()</a>, if <em>NULL</em> is returned, the original pointer <em>p</em> is freed (if it was not <em>NULL</em> itself). Otherwise the original pointer is either freed or returned as the reallocated result (in case it fits in-place with the new size). If the pointer <em>p</em> is <em>NULL</em>, it behaves as <em>mi_malloc</em>(<em>newsize</em>). If <em>newsize</em> is larger than the original <em>size</em> allocated for <em>p</em>, the bytes after <em>size</em> are uninitialized.</p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>pointer to the re-allocated memory of <em class="arg">newsize</em> bytes, or <em class="arg">NULL</em> if out of memory.</dd></dl>
|
||||
<p>In contrast to <a class="el" href="#ga0621af6a5e3aa384e6a1b548958bf583" title="Re-allocate memory to newsize bytes.">mi_realloc()</a>, if <em class="arg">NULL</em> is returned, the original pointer <em class="arg">p</em> is freed (if it was not <em class="arg">NULL</em> itself). Otherwise the original pointer is either freed or returned as the reallocated result (in case it fits in-place with the new size). If the pointer <em class="arg">p</em> is <em class="arg">NULL</em>, it behaves as <em class="arg">mi_malloc</em>(<em class="arg">newsize</em>). If <em class="arg">newsize</em> is larger than the original <em class="arg">size</em> allocated for <em class="arg">p</em>, the bytes after <em class="arg">size</em> are uninitialized.</p>
|
||||
<dl class="section see"><dt>See also</dt><dd><a href="https://www.freebsd.org/cgi/man.cgi?query=reallocf">reallocf</a> (on BSD) </dd></dl>
|
||||
|
||||
</div>
|
||||
@@ -394,16 +394,16 @@ mi_zallocn() </dd></dl>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Re-allocate memory to <em>count</em> elements of <em>size</em> bytes. </p>
|
||||
<p>Re-allocate memory to <em class="arg">count</em> elements of <em class="arg">size</em> bytes. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">p</td><td>Pointer to a previously allocated block (or <em>NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">p</td><td>Pointer to a previously allocated block (or <em class="arg">NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">count</td><td>The number of elements. </td></tr>
|
||||
<tr><td class="paramname">size</td><td>The size of each element. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>A pointer to a re-allocated block of <em>count</em> * <em>size</em> bytes, or <em>NULL</em> if out of memory or if <em>count</em> * <em>size</em> overflows.</dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>A pointer to a re-allocated block of <em class="arg">count</em> * <em class="arg">size</em> bytes, or <em class="arg">NULL</em> if out of memory or if <em class="arg">count</em> * <em class="arg">size</em> overflows.</dd></dl>
|
||||
<p>If there is no overflow, it behaves exactly like <code>mi_realloc(p,count*size)</code>. </p><dl class="section see"><dt>See also</dt><dd><a href="http://man.openbsd.org/reallocarray">reallocarray()</a> (on BSD) </dd></dl>
|
||||
|
||||
</div>
|
||||
@@ -431,13 +431,13 @@ mi_zallocn() </dd></dl>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">fname</td><td>File name. </td></tr>
|
||||
<tr><td class="paramname">resolved_name</td><td>Should be <em>NULL</em> (but can also point to a buffer of at least <em>PATH_MAX</em> bytes). </td></tr>
|
||||
<tr><td class="paramname">resolved_name</td><td>Should be <em class="arg">NULL</em> (but can also point to a buffer of at least <em class="arg">PATH_MAX</em> bytes). </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>If successful a pointer to the resolved absolute file name, or <em>NULL</em> on failure (with <em>errno</em> set to the error code).</dd></dl>
|
||||
<p>If <em>resolved_name</em> was <em>NULL</em>, the returned result should be freed with <a class="el" href="#gaf2c7b89c327d1f60f59e68b9ea644d95" title="Free previously allocated memory.">mi_free()</a>.</p>
|
||||
<p>Replacement for the standard <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html">realpath()</a> such that <a class="el" href="#gaf2c7b89c327d1f60f59e68b9ea644d95" title="Free previously allocated memory.">mi_free()</a> can be used on the returned result (if <em>resolved_name</em> was <em>NULL</em>). </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>If successful a pointer to the resolved absolute file name, or <em class="arg">NULL</em> on failure (with <em class="arg">errno</em> set to the error code).</dd></dl>
|
||||
<p>If <em class="arg">resolved_name</em> was <em class="arg">NULL</em>, the returned result should be freed with <a class="el" href="#gaf2c7b89c327d1f60f59e68b9ea644d95" title="Free previously allocated memory.">mi_free()</a>.</p>
|
||||
<p>Replacement for the standard <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html">realpath()</a> such that <a class="el" href="#gaf2c7b89c327d1f60f59e68b9ea644d95" title="Free previously allocated memory.">mi_free()</a> can be used on the returned result (if <em class="arg">resolved_name</em> was <em class="arg">NULL</em>). </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -465,16 +465,16 @@ mi_zallocn() </dd></dl>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Re-allocate memory to <em>count</em> elements of <em>size</em> bytes, with extra memory initialized to zero. </p>
|
||||
<p>Re-allocate memory to <em class="arg">count</em> elements of <em class="arg">size</em> bytes, with extra memory initialized to zero. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">p</td><td>Pointer to a previously allocated block (or <em>NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">p</td><td>Pointer to a previously allocated block (or <em class="arg">NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">count</td><td>The number of elements. </td></tr>
|
||||
<tr><td class="paramname">size</td><td>The size of each element. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>A pointer to a re-allocated block of <em>count</em> * <em>size</em> bytes, or <em>NULL</em> if out of memory or if <em>count</em> * <em>size</em> overflows.</dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>A pointer to a re-allocated block of <em class="arg">count</em> * <em class="arg">size</em> bytes, or <em class="arg">NULL</em> if out of memory or if <em class="arg">count</em> * <em class="arg">size</em> overflows.</dd></dl>
|
||||
<p>If there is no overflow, it behaves exactly like <code>mi_rezalloc(p,count*size)</code>. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="#ga8bddfb4a1270a0854bbcf44cb3980467" title="Re-allocate memory to count elements of size bytes.">mi_reallocn()</a> </dd>
|
||||
<dd>
|
||||
<a href="http://man.openbsd.org/reallocarray">recallocarray()</a> (on BSD). </dd></dl>
|
||||
@@ -499,11 +499,11 @@ mi_zallocn() </dd></dl>
|
||||
<p>Allocate and duplicate a string. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">s</td><td>string to duplicate (or <em>NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">s</td><td>string to duplicate (or <em class="arg">NULL</em>). </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a pointer to newly allocated memory initialized to string <em>s</em>, or <em>NULL</em> if either out of memory or if <em>s</em> is <em>NULL</em>.</dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a pointer to newly allocated memory initialized to string <em class="arg">s</em>, or <em class="arg">NULL</em> if either out of memory or if <em class="arg">s</em> is <em class="arg">NULL</em>.</dd></dl>
|
||||
<p>Replacement for the standard <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/strdup.html">strdup()</a> such that <a class="el" href="#gaf2c7b89c327d1f60f59e68b9ea644d95" title="Free previously allocated memory.">mi_free()</a> can be used on the returned result. </p>
|
||||
|
||||
</div>
|
||||
@@ -527,15 +527,15 @@ mi_zallocn() </dd></dl>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Allocate and duplicate a string up to <em>n</em> bytes. </p>
|
||||
<p>Allocate and duplicate a string up to <em class="arg">n</em> bytes. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">s</td><td>string to duplicate (or <em>NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">s</td><td>string to duplicate (or <em class="arg">NULL</em>). </td></tr>
|
||||
<tr><td class="paramname">n</td><td>maximum number of bytes to copy (excluding the terminating zero). </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a pointer to newly allocated memory initialized to string <em>s</em> up to the first <em>n</em> bytes (and always zero terminated), or <em>NULL</em> if either out of memory or if <em>s</em> is <em>NULL</em>.</dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a pointer to newly allocated memory initialized to string <em class="arg">s</em> up to the first <em class="arg">n</em> bytes (and always zero terminated), or <em class="arg">NULL</em> if either out of memory or if <em class="arg">s</em> is <em class="arg">NULL</em>.</dd></dl>
|
||||
<p>Replacement for the standard <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/strndup.html">strndup()</a> such that <a class="el" href="#gaf2c7b89c327d1f60f59e68b9ea644d95" title="Free previously allocated memory.">mi_free()</a> can be used on the returned result. </p>
|
||||
|
||||
</div>
|
||||
@@ -562,7 +562,7 @@ mi_zallocn() </dd></dl>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Pointer to newly allocated zero initialized memory, or <em>NULL</em> if out of memory. </dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Pointer to newly allocated zero initialized memory, or <em class="arg">NULL</em> if out of memory. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -571,7 +571,7 @@ mi_zallocn() </dd></dl>
|
||||
<!-- 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>
|
||||
<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.13.1 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user