| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
- <head>
- <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=11"/>
- <meta name="generator" content="Doxygen 1.12.0"/>
- <meta name="viewport" content="width=device-width, initial-scale=1"/>
- <title>Jolt Physics: Jolt/Core/STLAllocator.h Source File</title>
- <link href="tabs.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="jquery.js"></script>
- <script type="text/javascript" src="dynsections.js"></script>
- <script type="text/javascript" src="clipboard.js"></script>
- <link href="navtree.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="navtreedata.js"></script>
- <script type="text/javascript" src="navtree.js"></script>
- <script type="text/javascript" src="resize.js"></script>
- <script type="text/javascript" src="cookie.js"></script>
- <link href="search/search.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="search/searchdata.js"></script>
- <script type="text/javascript" src="search/search.js"></script>
- <script type="text/x-mathjax-config">
- MathJax.Hub.Config({
- extensions: ["tex2jax.js"],
- jax: ["input/TeX","output/HTML-CSS"],
- });
- </script>
- <script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"></script>
- <link href="doxygen.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
- <div id="titlearea">
- <table cellspacing="0" cellpadding="0">
- <tbody>
- <tr id="projectrow">
- <td id="projectlogo"><img alt="Logo" src="LogoSmall.png"/></td>
- <td id="projectalign">
- <div id="projectname">Jolt Physics
- </div>
- <div id="projectbrief">A multi core friendly Game Physics Engine</div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header part -->
- <!-- Generated by Doxygen 1.12.0 -->
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
- var searchBox = new SearchBox("searchBox", "search/",'.html');
- /* @license-end */
- </script>
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
- $(function() { codefold.init(0); });
- /* @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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
- $(function() {
- initMenu('',true,false,'search.php','Search',true);
- $(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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
- $(function(){initNavTree('_s_t_l_allocator_8h_source.html',''); initResizable(true); });
- /* @license-end */
- </script>
- <div id="doc-content">
- <!-- window showing the filter options -->
- <div id="MSearchSelectWindow"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- onkeydown="return searchBox.OnSearchSelectKey(event)">
- </div>
- <!-- iframe showing the search results (closed by default) -->
- <div id="MSearchResultsWindow">
- <div id="MSearchResults">
- <div class="SRPage">
- <div id="SRIndex">
- <div id="SRResults"></div>
- <div class="SRStatus" id="Loading">Loading...</div>
- <div class="SRStatus" id="Searching">Searching...</div>
- <div class="SRStatus" id="NoMatches">No Matches</div>
- </div>
- </div>
- </div>
- </div>
- <div class="header">
- <div class="headertitle"><div class="title">STLAllocator.h</div></div>
- </div><!--header-->
- <div class="contents">
- <a href="_s_t_l_allocator_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)</span></div>
- <div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// SPDX-FileCopyrightText: 2021 Jorrit Rouwe</span></div>
- <div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// SPDX-License-Identifier: MIT</span></div>
- <div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
- <div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#pragma once</span></div>
- <div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
- <div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><a class="code hl_define" href="_core_8h.html#ad14098b68b8c44ea6112601031268405">JPH_NAMESPACE_BEGIN</a></div>
- <div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
- <div class="line"><a id="l00010" name="l00010"></a><span class="lineno"><a class="line" href="struct_allocator_has_reallocate.html#ae70f528cd65b77e5ad75316300a3c7d5"> 10</a></span><span class="keyword">template</span> <<span class="keyword">class</span> T> <span class="keyword">struct </span><a class="code hl_struct" href="struct_allocator_has_reallocate.html">AllocatorHasReallocate</a> { <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_variable" href="struct_allocator_has_reallocate.html#ae70f528cd65b77e5ad75316300a3c7d5">sValue</a> = <span class="keyword">false</span>; };</div>
- <div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
- <div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#ifndef JPH_DISABLE_CUSTOM_ALLOCATOR</span></div>
- <div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
- <div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
- <div class="foldopen" id="foldopen00016" data-start="{" data-end="};">
- <div class="line"><a id="l00016" name="l00016"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html"> 16</a></span><span class="keyword">class </span><a class="code hl_class" href="class_s_t_l_allocator.html">STLAllocator</a></div>
- <div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span>{</div>
- <div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="keyword">public</span>:</div>
- <div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#aa77f889273432238722b3cb6ee8d54e3"> 19</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="class_s_t_l_allocator.html#aa77f889273432238722b3cb6ee8d54e3">value_type</a> = T;</div>
- <div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
- <div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#a6695227ea3840456beb77a4d6ad82e2a"> 22</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="class_s_t_l_allocator.html#a6695227ea3840456beb77a4d6ad82e2a">pointer</a> = T *;</div>
- <div class="line"><a id="l00023" name="l00023"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#af20979f6a464bc75ff11d09063e97ab7"> 23</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="class_s_t_l_allocator.html#af20979f6a464bc75ff11d09063e97ab7">const_pointer</a> = <span class="keyword">const</span> T *;</div>
- <div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div>
- <div class="line"><a id="l00027" name="l00027"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#affd8ec6c0ff2ea46a895cd9a6ca5ab7e"> 27</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="class_s_t_l_allocator.html#affd8ec6c0ff2ea46a895cd9a6ca5ab7e">reference</a> = T &;</div>
- <div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#a76d224a25fd13aab0e650c27fa0a667f"> 28</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="class_s_t_l_allocator.html#a76d224a25fd13aab0e650c27fa0a667f">const_reference</a> = <span class="keyword">const</span> T &;</div>
- <div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> </div>
- <div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#aac44f3272ab922012ffbc4f79b5916f1"> 30</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="class_s_t_l_allocator.html#aac44f3272ab922012ffbc4f79b5916f1">size_type</a> = size_t;</div>
- <div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#af1e0065d57c697896991790b3bc0b507"> 31</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="class_s_t_l_allocator.html#af1e0065d57c697896991790b3bc0b507">difference_type</a> = ptrdiff_t;</div>
- <div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
- <div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#aa4525a121f902e3456ee4d4c58aedf0e"> 34</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="class_s_t_l_allocator.html#aa4525a121f902e3456ee4d4c58aedf0e">is_always_equal</a> = std::true_type;</div>
- <div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
- <div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#a0d7b95a4beebe23ffc1dccce06aad884"> 37</a></span> <span class="keyword">using </span><a class="code hl_typedef" href="class_s_t_l_allocator.html#a0d7b95a4beebe23ffc1dccce06aad884">propagate_on_container_move_assignment</a> = std::true_type;</div>
- <div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
- <div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#a0971631bbfb181b844ee4f1f6cf987d8"> 40</a></span> <span class="keyword">inline</span> <a class="code hl_function" href="class_s_t_l_allocator.html#a0971631bbfb181b844ee4f1f6cf987d8">STLAllocator</a>() = <span class="keywordflow">default</span>;</div>
- <div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
- <div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T2></div>
- <div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#aca939c9a9e8a37dbc3ace546d3c843a5"> 44</a></span> <span class="keyword">inline</span> <a class="code hl_function" href="class_s_t_l_allocator.html#aca939c9a9e8a37dbc3ace546d3c843a5">STLAllocator</a>(<span class="keyword">const</span> <a class="code hl_class" href="class_s_t_l_allocator.html">STLAllocator<T2></a> &) { }</div>
- <div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
- <div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#a25990210a0d6bfe89040ed3258ff2dbc"> 47</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_variable" href="class_s_t_l_allocator.html#a25990210a0d6bfe89040ed3258ff2dbc">needs_aligned_allocate</a> = <span class="keyword">alignof</span>(T) > <a class="code hl_define" href="_core_8h.html#a25f22c6e1ee09e17aef6d6c1e9e6ce63">JPH_DEFAULT_ALLOCATE_ALIGNMENT</a>;</div>
- <div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> </div>
- <div class="foldopen" id="foldopen00050" data-start="{" data-end="}">
- <div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#a186cb0b0dae1eda7cf0436e4bc8a964b"> 50</a></span> <span class="keyword">inline</span> <a class="code hl_typedef" href="class_s_t_l_allocator.html#a6695227ea3840456beb77a4d6ad82e2a">pointer</a> <a class="code hl_function" href="class_s_t_l_allocator.html#a186cb0b0dae1eda7cf0436e4bc8a964b">allocate</a>(<a class="code hl_typedef" href="class_s_t_l_allocator.html#aac44f3272ab922012ffbc4f79b5916f1">size_type</a> inN)</div>
- <div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> {</div>
- <div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span> (<a class="code hl_variable" href="class_s_t_l_allocator.html#a25990210a0d6bfe89040ed3258ff2dbc">needs_aligned_allocate</a>)</div>
- <div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keywordflow">return</span> <a class="code hl_typedef" href="class_s_t_l_allocator.html#a6695227ea3840456beb77a4d6ad82e2a">pointer</a>(<a class="code hl_variable" href="_memory_8cpp.html#ae8854fb6cfcc5836d8e9f6103a3a6c68">AlignedAllocate</a>(inN * <span class="keyword">sizeof</span>(<a class="code hl_typedef" href="class_s_t_l_allocator.html#aa77f889273432238722b3cb6ee8d54e3">value_type</a>), <span class="keyword">alignof</span>(T)));</div>
- <div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordflow">else</span></div>
- <div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordflow">return</span> <a class="code hl_typedef" href="class_s_t_l_allocator.html#a6695227ea3840456beb77a4d6ad82e2a">pointer</a>(<a class="code hl_variable" href="_memory_8cpp.html#a409c61ab5ebd84e8aee6d9f930175a00">Allocate</a>(inN * <span class="keyword">sizeof</span>(<a class="code hl_typedef" href="class_s_t_l_allocator.html#aa77f889273432238722b3cb6ee8d54e3">value_type</a>)));</div>
- <div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> }</div>
- </div>
- <div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
- <div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#a537d1759c088ef656c537b834635c0dd"> 59</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_variable" href="class_s_t_l_allocator.html#a537d1759c088ef656c537b834635c0dd">has_reallocate</a> = std::is_trivially_copyable<T>() && !<a class="code hl_variable" href="class_s_t_l_allocator.html#a25990210a0d6bfe89040ed3258ff2dbc">needs_aligned_allocate</a>;</div>
- <div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> </div>
- <div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keyword">template</span> <<span class="keywordtype">bool</span> has_reallocate_v = has_reallocate, <span class="keyword">typename</span> = std::enable_if_t<has_reallocate_v>></div>
- <div class="foldopen" id="foldopen00063" data-start="{" data-end="}">
- <div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#aa023ac42875d9d843380abb6986888f1"> 63</a></span> <span class="keyword">inline</span> <a class="code hl_typedef" href="class_s_t_l_allocator.html#a6695227ea3840456beb77a4d6ad82e2a">pointer</a> <a class="code hl_function" href="class_s_t_l_allocator.html#aa023ac42875d9d843380abb6986888f1">reallocate</a>(<a class="code hl_typedef" href="class_s_t_l_allocator.html#a6695227ea3840456beb77a4d6ad82e2a">pointer</a> inOldPointer, <a class="code hl_typedef" href="class_s_t_l_allocator.html#aac44f3272ab922012ffbc4f79b5916f1">size_type</a> inOldSize, <a class="code hl_typedef" href="class_s_t_l_allocator.html#aac44f3272ab922012ffbc4f79b5916f1">size_type</a> inNewSize)</div>
- <div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> {</div>
- <div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <a class="code hl_define" href="_issue_reporting_8h.html#aaf6b1df827e11b7ca5f6f8778bd8f8cd">JPH_ASSERT</a>(inNewSize > 0); <span class="comment">// Reallocating to zero size is implementation dependent, so we don't allow it</span></div>
- <div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordflow">return</span> <a class="code hl_typedef" href="class_s_t_l_allocator.html#a6695227ea3840456beb77a4d6ad82e2a">pointer</a>(<a class="code hl_variable" href="_memory_8cpp.html#ac6c32afa44df59108c68ef07ce8919bd">Reallocate</a>(inOldPointer, inOldSize * <span class="keyword">sizeof</span>(<a class="code hl_typedef" href="class_s_t_l_allocator.html#aa77f889273432238722b3cb6ee8d54e3">value_type</a>), inNewSize * <span class="keyword">sizeof</span>(<a class="code hl_typedef" href="class_s_t_l_allocator.html#aa77f889273432238722b3cb6ee8d54e3">value_type</a>)));</div>
- <div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> }</div>
- </div>
- <div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> </div>
- <div class="foldopen" id="foldopen00070" data-start="{" data-end="}">
- <div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#aabc649e7365a3815c5f7fdd9f9d2b2df"> 70</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_s_t_l_allocator.html#aabc649e7365a3815c5f7fdd9f9d2b2df">deallocate</a>(<a class="code hl_typedef" href="class_s_t_l_allocator.html#a6695227ea3840456beb77a4d6ad82e2a">pointer</a> inPointer, <a class="code hl_typedef" href="class_s_t_l_allocator.html#aac44f3272ab922012ffbc4f79b5916f1">size_type</a>)</div>
- <div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> {</div>
- <div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span> (<a class="code hl_variable" href="class_s_t_l_allocator.html#a25990210a0d6bfe89040ed3258ff2dbc">needs_aligned_allocate</a>)</div>
- <div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <a class="code hl_variable" href="_memory_8cpp.html#add39c49c5cd22c9ddbc25aae2c01b5f3">AlignedFree</a>(inPointer);</div>
- <div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keywordflow">else</span></div>
- <div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <a class="code hl_variable" href="_memory_8cpp.html#acb8618ad315c24ed37db3ad6b2ff60fc">Free</a>(inPointer);</div>
- <div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> }</div>
- </div>
- <div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> </div>
- <div class="foldopen" id="foldopen00079" data-start="{" data-end="}">
- <div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#a851d3b50a4ebb59404de83b8da468df5"> 79</a></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="class_s_t_l_allocator.html#a851d3b50a4ebb59404de83b8da468df5">operator == </a>(<span class="keyword">const</span> <a class="code hl_class" href="class_s_t_l_allocator.html">STLAllocator<T></a> &)<span class="keyword"> const</span></div>
- <div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span><span class="keyword"> </span>{</div>
- <div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
- <div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> }</div>
- </div>
- <div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> </div>
- <div class="foldopen" id="foldopen00084" data-start="{" data-end="}">
- <div class="line"><a id="l00084" name="l00084"></a><span class="lineno"><a class="line" href="class_s_t_l_allocator.html#a9fc4be52711444b202331eca017b5e40"> 84</a></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="class_s_t_l_allocator.html#a9fc4be52711444b202331eca017b5e40">operator != </a>(<span class="keyword">const</span> <a class="code hl_class" href="class_s_t_l_allocator.html">STLAllocator<T></a> &)<span class="keyword"> const</span></div>
- <div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="keyword"> </span>{</div>
- <div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
- <div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> }</div>
- </div>
- <div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> </div>
- <div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T2></div>
- <div class="foldopen" id="foldopen00091" data-start="{" data-end="};">
- <div class="line"><a id="l00091" name="l00091"></a><span class="lineno"><a class="line" href="struct_s_t_l_allocator_1_1rebind.html"> 91</a></span> <span class="keyword">struct </span><a class="code hl_struct" href="struct_s_t_l_allocator_1_1rebind.html">rebind</a></div>
- <div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> {</div>
- <div class="line"><a id="l00093" name="l00093"></a><span class="lineno"><a class="line" href="struct_s_t_l_allocator_1_1rebind.html#a764b696ca1430862cf1226209b38bd34"> 93</a></span> <span class="keyword">using </span><a class="code hl_class" href="class_s_t_l_allocator.html">other</a> = <a class="code hl_class" href="class_s_t_l_allocator.html">STLAllocator<T2></a>;</div>
- <div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> };</div>
- </div>
- <div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span>};</div>
- </div>
- <div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> </div>
- <div class="line"><a id="l00098" name="l00098"></a><span class="lineno"><a class="line" href="struct_allocator_has_reallocate_3_01_s_t_l_allocator_3_01_t_01_4_01_4.html#a73bbcf686e73cd8b9c3bc905780f3af1"> 98</a></span><span class="keyword">template</span> <<span class="keyword">class</span> T> <span class="keyword">struct </span><a class="code hl_struct" href="struct_allocator_has_reallocate.html">AllocatorHasReallocate</a><<a class="code hl_class" href="class_s_t_l_allocator.html">STLAllocator</a><T>> { <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">bool</span> <a class="code hl_variable" href="struct_allocator_has_reallocate.html#ae70f528cd65b77e5ad75316300a3c7d5">sValue</a> = <a class="code hl_class" href="class_s_t_l_allocator.html">STLAllocator<T>::has_reallocate</a>; };</div>
- <div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> </div>
- <div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="preprocessor">#else</span></div>
- <div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> </div>
- <div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span><span class="keyword">template</span> <<span class="keyword">typename</span> T> <span class="keyword">using </span><a class="code hl_class" href="class_s_t_l_allocator.html">STLAllocator</a> = std::allocator<T>;</div>
- <div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> </div>
- <div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span><span class="preprocessor">#endif </span><span class="comment">// !JPH_DISABLE_CUSTOM_ALLOCATOR</span></div>
- <div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> </div>
- <div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span><span class="comment">// Declare STL containers that use our allocator</span></div>
- <div class="line"><a id="l00107" name="l00107"></a><span class="lineno"><a class="line" href="_s_t_l_allocator_8h.html#acfd9326153e4ff90e162d6e7d3e37c86"> 107</a></span><span class="keyword">using </span><a class="code hl_typedef" href="_s_t_l_allocator_8h.html#acfd9326153e4ff90e162d6e7d3e37c86">String</a> = std::basic_string<char, std::char_traits<char>, <a class="code hl_class" href="class_s_t_l_allocator.html">STLAllocator<char></a>>;</div>
- <div class="line"><a id="l00108" name="l00108"></a><span class="lineno"><a class="line" href="_s_t_l_allocator_8h.html#a4b38c58a2bae948d52cc8639833be07e"> 108</a></span><span class="keyword">using </span><a class="code hl_typedef" href="_s_t_l_allocator_8h.html#a4b38c58a2bae948d52cc8639833be07e">IStringStream</a> = std::basic_istringstream<char, std::char_traits<char>, <a class="code hl_class" href="class_s_t_l_allocator.html">STLAllocator<char></a>>;</div>
- <div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> </div>
- <div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span><a class="code hl_define" href="_core_8h.html#a73da8725998b00321a9db341202d650d">JPH_NAMESPACE_END</a></div>
- <div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> </div>
- <div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span><span class="preprocessor">#if (!defined(JPH_PLATFORM_WINDOWS) || defined(JPH_COMPILER_MINGW)) && !defined(JPH_DISABLE_CUSTOM_ALLOCATOR)</span></div>
- <div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> </div>
- <div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacestd.html">std</a></div>
- <div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span>{</div>
- <div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keyword">template</span> <></div>
- <div class="foldopen" id="foldopen00118" data-start="{" data-end="};">
- <div class="line"><a id="l00118" name="l00118"></a><span class="lineno"><a class="line" href="structstd_1_1hash_3_01_j_p_h_1_1_string_01_4.html"> 118</a></span> <span class="keyword">struct </span>hash<JPH::<a class="code hl_typedef" href="_s_t_l_allocator_8h.html#acfd9326153e4ff90e162d6e7d3e37c86">String</a>></div>
- <div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> {</div>
- <div class="foldopen" id="foldopen00120" data-start="{" data-end="}">
- <div class="line"><a id="l00120" name="l00120"></a><span class="lineno"><a class="line" href="structstd_1_1hash_3_01_j_p_h_1_1_string_01_4.html#a0571f6933c199a1ded43c68ca4b173f0"> 120</a></span> <span class="keyword">inline</span> <span class="keywordtype">size_t</span> operator () (<span class="keyword">const</span> JPH::String &inRHS)<span class="keyword"> const</span></div>
- <div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span><span class="keyword"> </span>{</div>
- <div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keywordflow">return</span> hash<string_view> { } (inRHS);</div>
- <div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> }</div>
- </div>
- <div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> };</div>
- </div>
- <div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span>}</div>
- <div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> </div>
- <div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span><span class="preprocessor">#endif </span><span class="comment">// (!JPH_PLATFORM_WINDOWS || JPH_COMPILER_MINGW) && !JPH_DISABLE_CUSTOM_ALLOCATOR</span></div>
- <div class="ttc" id="a_core_8h_html_a25f22c6e1ee09e17aef6d6c1e9e6ce63"><div class="ttname"><a href="_core_8h.html#a25f22c6e1ee09e17aef6d6c1e9e6ce63">JPH_DEFAULT_ALLOCATE_ALIGNMENT</a></div><div class="ttdeci">#define JPH_DEFAULT_ALLOCATE_ALIGNMENT</div><div class="ttdef"><b>Definition</b> Core.h:540</div></div>
- <div class="ttc" id="a_core_8h_html_a73da8725998b00321a9db341202d650d"><div class="ttname"><a href="_core_8h.html#a73da8725998b00321a9db341202d650d">JPH_NAMESPACE_END</a></div><div class="ttdeci">#define JPH_NAMESPACE_END</div><div class="ttdef"><b>Definition</b> Core.h:425</div></div>
- <div class="ttc" id="a_core_8h_html_ad14098b68b8c44ea6112601031268405"><div class="ttname"><a href="_core_8h.html#ad14098b68b8c44ea6112601031268405">JPH_NAMESPACE_BEGIN</a></div><div class="ttdeci">#define JPH_NAMESPACE_BEGIN</div><div class="ttdef"><b>Definition</b> Core.h:419</div></div>
- <div class="ttc" id="a_issue_reporting_8h_html_aaf6b1df827e11b7ca5f6f8778bd8f8cd"><div class="ttname"><a href="_issue_reporting_8h.html#aaf6b1df827e11b7ca5f6f8778bd8f8cd">JPH_ASSERT</a></div><div class="ttdeci">#define JPH_ASSERT(...)</div><div class="ttdef"><b>Definition</b> IssueReporting.h:33</div></div>
- <div class="ttc" id="a_memory_8cpp_html_a409c61ab5ebd84e8aee6d9f930175a00"><div class="ttname"><a href="_memory_8cpp.html#a409c61ab5ebd84e8aee6d9f930175a00">Allocate</a></div><div class="ttdeci">AllocateFunction Allocate</div><div class="ttdef"><b>Definition</b> Memory.cpp:68</div></div>
- <div class="ttc" id="a_memory_8cpp_html_ac6c32afa44df59108c68ef07ce8919bd"><div class="ttname"><a href="_memory_8cpp.html#ac6c32afa44df59108c68ef07ce8919bd">Reallocate</a></div><div class="ttdeci">ReallocateFunction Reallocate</div><div class="ttdef"><b>Definition</b> Memory.cpp:69</div></div>
- <div class="ttc" id="a_memory_8cpp_html_acb8618ad315c24ed37db3ad6b2ff60fc"><div class="ttname"><a href="_memory_8cpp.html#acb8618ad315c24ed37db3ad6b2ff60fc">Free</a></div><div class="ttdeci">FreeFunction Free</div><div class="ttdef"><b>Definition</b> Memory.cpp:70</div></div>
- <div class="ttc" id="a_memory_8cpp_html_add39c49c5cd22c9ddbc25aae2c01b5f3"><div class="ttname"><a href="_memory_8cpp.html#add39c49c5cd22c9ddbc25aae2c01b5f3">AlignedFree</a></div><div class="ttdeci">AlignedFreeFunction AlignedFree</div><div class="ttdef"><b>Definition</b> Memory.cpp:72</div></div>
- <div class="ttc" id="a_memory_8cpp_html_ae8854fb6cfcc5836d8e9f6103a3a6c68"><div class="ttname"><a href="_memory_8cpp.html#ae8854fb6cfcc5836d8e9f6103a3a6c68">AlignedAllocate</a></div><div class="ttdeci">AlignedAllocateFunction AlignedAllocate</div><div class="ttdef"><b>Definition</b> Memory.cpp:71</div></div>
- <div class="ttc" id="a_s_t_l_allocator_8h_html_a4b38c58a2bae948d52cc8639833be07e"><div class="ttname"><a href="_s_t_l_allocator_8h.html#a4b38c58a2bae948d52cc8639833be07e">IStringStream</a></div><div class="ttdeci">std::basic_istringstream< char, std::char_traits< char >, STLAllocator< char > > IStringStream</div><div class="ttdef"><b>Definition</b> STLAllocator.h:108</div></div>
- <div class="ttc" id="a_s_t_l_allocator_8h_html_acfd9326153e4ff90e162d6e7d3e37c86"><div class="ttname"><a href="_s_t_l_allocator_8h.html#acfd9326153e4ff90e162d6e7d3e37c86">String</a></div><div class="ttdeci">std::basic_string< char, std::char_traits< char >, STLAllocator< char > > String</div><div class="ttdef"><b>Definition</b> STLAllocator.h:107</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html"><div class="ttname"><a href="class_s_t_l_allocator.html">STLAllocator</a></div><div class="ttdoc">STL allocator that forwards to our allocation functions.</div><div class="ttdef"><b>Definition</b> STLAllocator.h:17</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_a0971631bbfb181b844ee4f1f6cf987d8"><div class="ttname"><a href="class_s_t_l_allocator.html#a0971631bbfb181b844ee4f1f6cf987d8">STLAllocator::STLAllocator</a></div><div class="ttdeci">STLAllocator()=default</div><div class="ttdoc">Constructor.</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_a0d7b95a4beebe23ffc1dccce06aad884"><div class="ttname"><a href="class_s_t_l_allocator.html#a0d7b95a4beebe23ffc1dccce06aad884">STLAllocator::propagate_on_container_move_assignment</a></div><div class="ttdeci">std::true_type propagate_on_container_move_assignment</div><div class="ttdoc">Allocator supports moving.</div><div class="ttdef"><b>Definition</b> STLAllocator.h:37</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_a186cb0b0dae1eda7cf0436e4bc8a964b"><div class="ttname"><a href="class_s_t_l_allocator.html#a186cb0b0dae1eda7cf0436e4bc8a964b">STLAllocator::allocate</a></div><div class="ttdeci">pointer allocate(size_type inN)</div><div class="ttdoc">Allocate memory.</div><div class="ttdef"><b>Definition</b> STLAllocator.h:50</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_a25990210a0d6bfe89040ed3258ff2dbc"><div class="ttname"><a href="class_s_t_l_allocator.html#a25990210a0d6bfe89040ed3258ff2dbc">STLAllocator::needs_aligned_allocate</a></div><div class="ttdeci">static constexpr bool needs_aligned_allocate</div><div class="ttdoc">If this allocator needs to fall back to aligned allocations because the type requires it.</div><div class="ttdef"><b>Definition</b> STLAllocator.h:47</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_a537d1759c088ef656c537b834635c0dd"><div class="ttname"><a href="class_s_t_l_allocator.html#a537d1759c088ef656c537b834635c0dd">STLAllocator::has_reallocate</a></div><div class="ttdeci">static constexpr bool has_reallocate</div><div class="ttdoc">Should we expose a reallocate function?</div><div class="ttdef"><b>Definition</b> STLAllocator.h:59</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_a6695227ea3840456beb77a4d6ad82e2a"><div class="ttname"><a href="class_s_t_l_allocator.html#a6695227ea3840456beb77a4d6ad82e2a">STLAllocator::pointer</a></div><div class="ttdeci">T * pointer</div><div class="ttdoc">Pointer to type.</div><div class="ttdef"><b>Definition</b> STLAllocator.h:22</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_a76d224a25fd13aab0e650c27fa0a667f"><div class="ttname"><a href="class_s_t_l_allocator.html#a76d224a25fd13aab0e650c27fa0a667f">STLAllocator::const_reference</a></div><div class="ttdeci">const T & const_reference</div><div class="ttdef"><b>Definition</b> STLAllocator.h:28</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_a851d3b50a4ebb59404de83b8da468df5"><div class="ttname"><a href="class_s_t_l_allocator.html#a851d3b50a4ebb59404de83b8da468df5">STLAllocator::operator==</a></div><div class="ttdeci">bool operator==(const STLAllocator< T > &) const</div><div class="ttdoc">Allocators are stateless so assumed to be equal.</div><div class="ttdef"><b>Definition</b> STLAllocator.h:79</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_a9fc4be52711444b202331eca017b5e40"><div class="ttname"><a href="class_s_t_l_allocator.html#a9fc4be52711444b202331eca017b5e40">STLAllocator::operator!=</a></div><div class="ttdeci">bool operator!=(const STLAllocator< T > &) const</div><div class="ttdef"><b>Definition</b> STLAllocator.h:84</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_aa023ac42875d9d843380abb6986888f1"><div class="ttname"><a href="class_s_t_l_allocator.html#aa023ac42875d9d843380abb6986888f1">STLAllocator::reallocate</a></div><div class="ttdeci">pointer reallocate(pointer inOldPointer, size_type inOldSize, size_type inNewSize)</div><div class="ttdoc">Reallocate memory.</div><div class="ttdef"><b>Definition</b> STLAllocator.h:63</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_aa4525a121f902e3456ee4d4c58aedf0e"><div class="ttname"><a href="class_s_t_l_allocator.html#aa4525a121f902e3456ee4d4c58aedf0e">STLAllocator::is_always_equal</a></div><div class="ttdeci">std::true_type is_always_equal</div><div class="ttdoc">The allocator is stateless.</div><div class="ttdef"><b>Definition</b> STLAllocator.h:34</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_aa77f889273432238722b3cb6ee8d54e3"><div class="ttname"><a href="class_s_t_l_allocator.html#aa77f889273432238722b3cb6ee8d54e3">STLAllocator::value_type</a></div><div class="ttdeci">T value_type</div><div class="ttdef"><b>Definition</b> STLAllocator.h:19</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_aabc649e7365a3815c5f7fdd9f9d2b2df"><div class="ttname"><a href="class_s_t_l_allocator.html#aabc649e7365a3815c5f7fdd9f9d2b2df">STLAllocator::deallocate</a></div><div class="ttdeci">void deallocate(pointer inPointer, size_type)</div><div class="ttdoc">Free memory.</div><div class="ttdef"><b>Definition</b> STLAllocator.h:70</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_aac44f3272ab922012ffbc4f79b5916f1"><div class="ttname"><a href="class_s_t_l_allocator.html#aac44f3272ab922012ffbc4f79b5916f1">STLAllocator::size_type</a></div><div class="ttdeci">size_t size_type</div><div class="ttdef"><b>Definition</b> STLAllocator.h:30</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_aca939c9a9e8a37dbc3ace546d3c843a5"><div class="ttname"><a href="class_s_t_l_allocator.html#aca939c9a9e8a37dbc3ace546d3c843a5">STLAllocator::STLAllocator</a></div><div class="ttdeci">STLAllocator(const STLAllocator< T2 > &)</div><div class="ttdoc">Constructor from other allocator.</div><div class="ttdef"><b>Definition</b> STLAllocator.h:44</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_af1e0065d57c697896991790b3bc0b507"><div class="ttname"><a href="class_s_t_l_allocator.html#af1e0065d57c697896991790b3bc0b507">STLAllocator::difference_type</a></div><div class="ttdeci">ptrdiff_t difference_type</div><div class="ttdef"><b>Definition</b> STLAllocator.h:31</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_af20979f6a464bc75ff11d09063e97ab7"><div class="ttname"><a href="class_s_t_l_allocator.html#af20979f6a464bc75ff11d09063e97ab7">STLAllocator::const_pointer</a></div><div class="ttdeci">const T * const_pointer</div><div class="ttdef"><b>Definition</b> STLAllocator.h:23</div></div>
- <div class="ttc" id="aclass_s_t_l_allocator_html_affd8ec6c0ff2ea46a895cd9a6ca5ab7e"><div class="ttname"><a href="class_s_t_l_allocator.html#affd8ec6c0ff2ea46a895cd9a6ca5ab7e">STLAllocator::reference</a></div><div class="ttdeci">T & reference</div><div class="ttdef"><b>Definition</b> STLAllocator.h:27</div></div>
- <div class="ttc" id="anamespacestd_html"><div class="ttname"><a href="namespacestd.html">std</a></div><div class="ttdef"><b>Definition</b> Array.h:699</div></div>
- <div class="ttc" id="astruct_allocator_has_reallocate_html"><div class="ttname"><a href="struct_allocator_has_reallocate.html">AllocatorHasReallocate</a></div><div class="ttdoc">Default implementation of AllocatorHasReallocate which tells if an allocator has a reallocate functio...</div><div class="ttdef"><b>Definition</b> STLAllocator.h:10</div></div>
- <div class="ttc" id="astruct_allocator_has_reallocate_html_ae70f528cd65b77e5ad75316300a3c7d5"><div class="ttname"><a href="struct_allocator_has_reallocate.html#ae70f528cd65b77e5ad75316300a3c7d5">AllocatorHasReallocate::sValue</a></div><div class="ttdeci">static constexpr bool sValue</div><div class="ttdef"><b>Definition</b> STLAllocator.h:10</div></div>
- <div class="ttc" id="astruct_s_t_l_allocator_1_1rebind_html"><div class="ttname"><a href="struct_s_t_l_allocator_1_1rebind.html">STLAllocator::rebind</a></div><div class="ttdoc">Converting to allocator for other type.</div><div class="ttdef"><b>Definition</b> STLAllocator.h:92</div></div>
- </div><!-- fragment --></div><!-- contents -->
- </div><!-- doc-content -->
- <!-- start footer part -->
- <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
- <ul>
- <li class="navelem"><a class="el" href="dir_d99289a5d3c46cf26f14ff6c90658d9f.html">Jolt</a></li><li class="navelem"><a class="el" href="dir_1b21a6f5692b6d84bf3b848a79181d46.html">Core</a></li><li class="navelem"><a class="el" href="_s_t_l_allocator_8h.html">STLAllocator.h</a></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.12.0 </li>
- </ul>
- </div>
- </body>
- </html>
|