Files
recastnavigation/DetourAlloc_8h.html
T

310 lines
17 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Recast Navigation: DetourAlloc.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Recast Navigation
</div>
<div id="projectbrief">Navigation-mesh Toolset for Games</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('DetourAlloc_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">DetourAlloc.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stddef.h&gt;</code><br />
</div>
<p><a href="DetourAlloc_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a5ff0ad0a4309278f973feae6c4193a3c"><td class="memItemLeft" align="right" valign="top">typedef void *()&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="DetourAlloc_8h.html#a5ff0ad0a4309278f973feae6c4193a3c">dtAllocFunc</a>(size_t size, <a class="el" href="DetourAlloc_8h.html#a318bc084ec7fefd878cd36e0846bd14d">dtAllocHint</a> hint)</td></tr>
<tr class="memdesc:a5ff0ad0a4309278f973feae6c4193a3c"><td class="mdescLeft">&#160;</td><td class="mdescRight">A memory allocation function. <a href="DetourAlloc_8h.html#a5ff0ad0a4309278f973feae6c4193a3c">More...</a><br /></td></tr>
<tr class="separator:a5ff0ad0a4309278f973feae6c4193a3c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a15d9afa65e6a83a6188c7efa3fa50376"><td class="memItemLeft" align="right" valign="top">typedef void()&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="DetourAlloc_8h.html#a15d9afa65e6a83a6188c7efa3fa50376">dtFreeFunc</a>(void *ptr)</td></tr>
<tr class="memdesc:a15d9afa65e6a83a6188c7efa3fa50376"><td class="mdescLeft">&#160;</td><td class="mdescRight">A memory deallocation function. <a href="DetourAlloc_8h.html#a15d9afa65e6a83a6188c7efa3fa50376">More...</a><br /></td></tr>
<tr class="separator:a15d9afa65e6a83a6188c7efa3fa50376"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a318bc084ec7fefd878cd36e0846bd14d"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="DetourAlloc_8h.html#a318bc084ec7fefd878cd36e0846bd14d">dtAllocHint</a> { <a class="el" href="DetourAlloc_8h.html#a318bc084ec7fefd878cd36e0846bd14da4b5dc5bf08bcea4978a84327c7faf39f">DT_ALLOC_PERM</a>
, <a class="el" href="DetourAlloc_8h.html#a318bc084ec7fefd878cd36e0846bd14da345c28489f1d9c43bb8d528b4dab5aee">DT_ALLOC_TEMP</a>
}</td></tr>
<tr class="memdesc:a318bc084ec7fefd878cd36e0846bd14d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides hint values to the memory allocator on how long the memory is expected to be used. <a href="DetourAlloc_8h.html#a318bc084ec7fefd878cd36e0846bd14d">More...</a><br /></td></tr>
<tr class="separator:a318bc084ec7fefd878cd36e0846bd14d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:af867be65f8ee4fcdcabd89cca01f2f4a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="DetourAlloc_8h.html#af867be65f8ee4fcdcabd89cca01f2f4a">dtAllocSetCustom</a> (<a class="el" href="DetourAlloc_8h.html#a5ff0ad0a4309278f973feae6c4193a3c">dtAllocFunc</a> *allocFunc, <a class="el" href="DetourAlloc_8h.html#a15d9afa65e6a83a6188c7efa3fa50376">dtFreeFunc</a> *freeFunc)</td></tr>
<tr class="memdesc:af867be65f8ee4fcdcabd89cca01f2f4a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the base custom allocation functions to be used by Detour. <a href="DetourAlloc_8h.html#af867be65f8ee4fcdcabd89cca01f2f4a">More...</a><br /></td></tr>
<tr class="separator:af867be65f8ee4fcdcabd89cca01f2f4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac7a1c461b037f7cc0cd1b2e480d12920"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="DetourAlloc_8h.html#ac7a1c461b037f7cc0cd1b2e480d12920">dtAlloc</a> (size_t size, <a class="el" href="DetourAlloc_8h.html#a318bc084ec7fefd878cd36e0846bd14d">dtAllocHint</a> hint)</td></tr>
<tr class="memdesc:ac7a1c461b037f7cc0cd1b2e480d12920"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocates a memory block. <a href="DetourAlloc_8h.html#ac7a1c461b037f7cc0cd1b2e480d12920">More...</a><br /></td></tr>
<tr class="separator:ac7a1c461b037f7cc0cd1b2e480d12920"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb7919ae2642d1a487ce5fce6ae3af0d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="DetourAlloc_8h.html#adb7919ae2642d1a487ce5fce6ae3af0d">dtFree</a> (void *ptr)</td></tr>
<tr class="memdesc:adb7919ae2642d1a487ce5fce6ae3af0d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deallocates a memory block. <a href="DetourAlloc_8h.html#adb7919ae2642d1a487ce5fce6ae3af0d">More...</a><br /></td></tr>
<tr class="separator:adb7919ae2642d1a487ce5fce6ae3af0d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="a5ff0ad0a4309278f973feae6c4193a3c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5ff0ad0a4309278f973feae6c4193a3c">&#9670;&nbsp;</a></span>dtAllocFunc</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void*() dtAllocFunc(size_t size, <a class="el" href="DetourAlloc_8h.html#a318bc084ec7fefd878cd36e0846bd14d">dtAllocHint</a> hint)</td>
</tr>
</table>
</div><div class="memdoc">
<p>A memory allocation function. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="DetourAlloc_8h.html#af867be65f8ee4fcdcabd89cca01f2f4a" title="Sets the base custom allocation functions to be used by Detour.">dtAllocSetCustom</a> </dd></dl>
</div>
</div>
<a id="a15d9afa65e6a83a6188c7efa3fa50376"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a15d9afa65e6a83a6188c7efa3fa50376">&#9670;&nbsp;</a></span>dtFreeFunc</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void() dtFreeFunc(void *ptr)</td>
</tr>
</table>
</div><div class="memdoc">
<p>A memory deallocation function. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ptr</td><td>A pointer to a memory block previously allocated using <a class="el" href="DetourAlloc_8h.html#a5ff0ad0a4309278f973feae6c4193a3c" title="A memory allocation function.">dtAllocFunc</a>. </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="DetourAlloc_8h.html#af867be65f8ee4fcdcabd89cca01f2f4a" title="Sets the base custom allocation functions to be used by Detour.">dtAllocSetCustom</a> </dd></dl>
</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="a318bc084ec7fefd878cd36e0846bd14d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a318bc084ec7fefd878cd36e0846bd14d">&#9670;&nbsp;</a></span>dtAllocHint</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="DetourAlloc_8h.html#a318bc084ec7fefd878cd36e0846bd14d">dtAllocHint</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Provides hint values to the memory allocator on how long the memory is expected to be used. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a318bc084ec7fefd878cd36e0846bd14da4b5dc5bf08bcea4978a84327c7faf39f"></a>DT_ALLOC_PERM&#160;</td><td class="fielddoc"><p>Memory persist after a function call. </p>
</td></tr>
<tr><td class="fieldname"><a id="a318bc084ec7fefd878cd36e0846bd14da345c28489f1d9c43bb8d528b4dab5aee"></a>DT_ALLOC_TEMP&#160;</td><td class="fielddoc"><p>Memory used temporarily within a function. </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ac7a1c461b037f7cc0cd1b2e480d12920"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac7a1c461b037f7cc0cd1b2e480d12920">&#9670;&nbsp;</a></span>dtAlloc()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void* dtAlloc </td>
<td>(</td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>size</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="DetourAlloc_8h.html#a318bc084ec7fefd878cd36e0846bd14d">dtAllocHint</a>&#160;</td>
<td class="paramname"><em>hint</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Allocates a memory block. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>The size, in bytes of memory, to allocate. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">hint</td><td>A hint to the allocator on how long the memory is expected to be in use. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the beginning of the allocated memory block, or null if the allocation failed. </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="DetourAlloc_8h.html#adb7919ae2642d1a487ce5fce6ae3af0d" title="Deallocates a memory block.">dtFree</a> </dd></dl>
</div>
</div>
<a id="af867be65f8ee4fcdcabd89cca01f2f4a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af867be65f8ee4fcdcabd89cca01f2f4a">&#9670;&nbsp;</a></span>dtAllocSetCustom()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void dtAllocSetCustom </td>
<td>(</td>
<td class="paramtype"><a class="el" href="DetourAlloc_8h.html#a5ff0ad0a4309278f973feae6c4193a3c">dtAllocFunc</a> *&#160;</td>
<td class="paramname"><em>allocFunc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="DetourAlloc_8h.html#a15d9afa65e6a83a6188c7efa3fa50376">dtFreeFunc</a> *&#160;</td>
<td class="paramname"><em>freeFunc</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the base custom allocation functions to be used by Detour. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">allocFunc</td><td>The memory allocation function to be used by <a class="el" href="DetourAlloc_8h.html#ac7a1c461b037f7cc0cd1b2e480d12920" title="Allocates a memory block.">dtAlloc</a> </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">freeFunc</td><td>The memory de-allocation function to be used by <a class="el" href="DetourAlloc_8h.html#adb7919ae2642d1a487ce5fce6ae3af0d" title="Deallocates a memory block.">dtFree</a> </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="adb7919ae2642d1a487ce5fce6ae3af0d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adb7919ae2642d1a487ce5fce6ae3af0d">&#9670;&nbsp;</a></span>dtFree()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void dtFree </td>
<td>(</td>
<td class="paramtype">void *&#160;</td>
<td class="paramname"><em>ptr</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Deallocates a memory block. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ptr</td><td>A pointer to a memory block previously allocated using <a class="el" href="DetourAlloc_8h.html#ac7a1c461b037f7cc0cd1b2e480d12920" title="Allocates a memory block.">dtAlloc</a>. </td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="DetourAlloc_8h.html#ac7a1c461b037f7cc0cd1b2e480d12920" title="Allocates a memory block.">dtAlloc</a> </dd></dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_49bbc5a28a7ee729bdecc682ba5a63c9.html">Detour</a></li><li class="navelem"><a class="el" href="dir_97c6bac6df0065e0578eb2a70aa0bb50.html">Include</a></li><li class="navelem"><a class="el" href="DetourAlloc_8h.html">DetourAlloc.h</a></li>
&nbsp;&nbsp;<a href="https://github.com/recastnavigation/recastnavigation">Project Home</a>
| <a href="./License.txt">Licence (ZLib)</a>
| Copyright 2009 Mikko Mononen
</ul>
</div>
</body>
</html>