<!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.8.15"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Crypto++: FixedSizeAllocatorWithCleanup< T, S, A, T_Align16 > Class Template 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="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 style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Crypto++  <span id="projectnumber">7.0</span> </div> <div id="projectbrief">Free C++ class library of cryptographic schemes</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.15 --> <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&dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('',false,false,'search.php','Search'); }); /* @license-end */</script> <div id="main-nav"></div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-types">Public Types</a> | <a href="#pub-methods">Public Member Functions</a> | <a href="class_fixed_size_allocator_with_cleanup-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">FixedSizeAllocatorWithCleanup< T, S, A, T_Align16 > Class Template Reference</div> </div> </div><!--header--> <div class="contents"> <p>Static secure memory block with cleanup. <a href="class_fixed_size_allocator_with_cleanup.html#details">More...</a></p> <div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;"> <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for FixedSizeAllocatorWithCleanup< T, S, A, T_Align16 >:</div> <div id="dynsection-0-summary" class="dynsummary" style="display:block;"> </div> <div id="dynsection-0-content" class="dyncontent" style="display:none;"> <div class="center"> <img src="class_fixed_size_allocator_with_cleanup.png" usemap="#FixedSizeAllocatorWithCleanup_3C_20T_2C_20S_2C_20A_2C_20T_5FAlign16_20_3E_map" alt=""/> <map id="FixedSizeAllocatorWithCleanup_3C_20T_2C_20S_2C_20A_2C_20T_5FAlign16_20_3E_map" name="FixedSizeAllocatorWithCleanup_3C_20T_2C_20S_2C_20A_2C_20T_5FAlign16_20_3E_map"> <area href="class_allocator_base.html" title="Base class for all allocators used by SecBlock." alt="AllocatorBase< T >" shape="rect" coords="0,0,321,24"/> </map> </div></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a> Public Types</h2></td></tr> <tr class="memitem:ab83b67f27d7d9a024090fca6a955581f"><td class="memItemLeft" align="right" valign="top"><a id="ab83b67f27d7d9a024090fca6a955581f"></a> typedef <a class="el" href="class_allocator_base.html">AllocatorBase</a>< T >::value_type </td><td class="memItemRight" valign="bottom"><b>value_type</b></td></tr> <tr class="separator:ab83b67f27d7d9a024090fca6a955581f"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:abcc016350706c04d7a2660659a3d19f0"><td class="memItemLeft" align="right" valign="top"><a id="abcc016350706c04d7a2660659a3d19f0"></a> typedef <a class="el" href="class_allocator_base.html">AllocatorBase</a>< T >::size_type </td><td class="memItemRight" valign="bottom"><b>size_type</b></td></tr> <tr class="separator:abcc016350706c04d7a2660659a3d19f0"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a808beedd919185d5d0944908ad2249c2"><td class="memItemLeft" align="right" valign="top"><a id="a808beedd919185d5d0944908ad2249c2"></a> typedef <a class="el" href="class_allocator_base.html">AllocatorBase</a>< T >::difference_type </td><td class="memItemRight" valign="bottom"><b>difference_type</b></td></tr> <tr class="separator:a808beedd919185d5d0944908ad2249c2"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ae3253e1533a1405e93aef8af443e9c16"><td class="memItemLeft" align="right" valign="top"><a id="ae3253e1533a1405e93aef8af443e9c16"></a> typedef <a class="el" href="class_allocator_base.html">AllocatorBase</a>< T >::pointer </td><td class="memItemRight" valign="bottom"><b>pointer</b></td></tr> <tr class="separator:ae3253e1533a1405e93aef8af443e9c16"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad272521e81121c2d1dba2ad80af79a0b"><td class="memItemLeft" align="right" valign="top"><a id="ad272521e81121c2d1dba2ad80af79a0b"></a> typedef <a class="el" href="class_allocator_base.html">AllocatorBase</a>< T >::const_pointer </td><td class="memItemRight" valign="bottom"><b>const_pointer</b></td></tr> <tr class="separator:ad272521e81121c2d1dba2ad80af79a0b"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a10d23c731269d543f239259a35a91b47"><td class="memItemLeft" align="right" valign="top"><a id="a10d23c731269d543f239259a35a91b47"></a> typedef <a class="el" href="class_allocator_base.html">AllocatorBase</a>< T >::reference </td><td class="memItemRight" valign="bottom"><b>reference</b></td></tr> <tr class="separator:a10d23c731269d543f239259a35a91b47"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a1fa26031c6dbcef2380b7f83ffc52dc7"><td class="memItemLeft" align="right" valign="top"><a id="a1fa26031c6dbcef2380b7f83ffc52dc7"></a> typedef <a class="el" href="class_allocator_base.html">AllocatorBase</a>< T >::const_reference </td><td class="memItemRight" valign="bottom"><b>const_reference</b></td></tr> <tr class="separator:a1fa26031c6dbcef2380b7f83ffc52dc7"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_types_class_allocator_base"><td colspan="2" onclick="javascript:toggleInherit('pub_types_class_allocator_base')"><img src="closed.png" alt="-"/> Public Types inherited from <a class="el" href="class_allocator_base.html">AllocatorBase< T ></a></td></tr> <tr class="memitem:a461f6d214f73761bb656a76db8f608c0 inherit pub_types_class_allocator_base"><td class="memItemLeft" align="right" valign="top"><a id="a461f6d214f73761bb656a76db8f608c0"></a> typedef T </td><td class="memItemRight" valign="bottom"><b>value_type</b></td></tr> <tr class="separator:a461f6d214f73761bb656a76db8f608c0 inherit pub_types_class_allocator_base"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:adda200f657efdba2d08e80ee9a7f244d inherit pub_types_class_allocator_base"><td class="memItemLeft" align="right" valign="top"><a id="adda200f657efdba2d08e80ee9a7f244d"></a> typedef size_t </td><td class="memItemRight" valign="bottom"><b>size_type</b></td></tr> <tr class="separator:adda200f657efdba2d08e80ee9a7f244d inherit pub_types_class_allocator_base"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a10c1b15630e208c28183b72debcff98c inherit pub_types_class_allocator_base"><td class="memItemLeft" align="right" valign="top"><a id="a10c1b15630e208c28183b72debcff98c"></a> typedef std::ptrdiff_t </td><td class="memItemRight" valign="bottom"><b>difference_type</b></td></tr> <tr class="separator:a10c1b15630e208c28183b72debcff98c inherit pub_types_class_allocator_base"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a719f87a9b5da234dbc8c8c1c88be253c inherit pub_types_class_allocator_base"><td class="memItemLeft" align="right" valign="top"><a id="a719f87a9b5da234dbc8c8c1c88be253c"></a> typedef T * </td><td class="memItemRight" valign="bottom"><b>pointer</b></td></tr> <tr class="separator:a719f87a9b5da234dbc8c8c1c88be253c inherit pub_types_class_allocator_base"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a3ac778a475e77ea22ff8e7bea2aa983e inherit pub_types_class_allocator_base"><td class="memItemLeft" align="right" valign="top"><a id="a3ac778a475e77ea22ff8e7bea2aa983e"></a> typedef const T * </td><td class="memItemRight" valign="bottom"><b>const_pointer</b></td></tr> <tr class="separator:a3ac778a475e77ea22ff8e7bea2aa983e inherit pub_types_class_allocator_base"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a151889fd23094bf841959ab226708f83 inherit pub_types_class_allocator_base"><td class="memItemLeft" align="right" valign="top"><a id="a151889fd23094bf841959ab226708f83"></a> typedef T & </td><td class="memItemRight" valign="bottom"><b>reference</b></td></tr> <tr class="separator:a151889fd23094bf841959ab226708f83 inherit pub_types_class_allocator_base"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a3ad08c82939fd8b18621a1d870a0d10e inherit pub_types_class_allocator_base"><td class="memItemLeft" align="right" valign="top"><a id="a3ad08c82939fd8b18621a1d870a0d10e"></a> typedef const T & </td><td class="memItemRight" valign="bottom"><b>const_reference</b></td></tr> <tr class="separator:a3ad08c82939fd8b18621a1d870a0d10e inherit pub_types_class_allocator_base"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:aa8ce1fc8c74012dccf3add4e60b2636b"><td class="memItemLeft" align="right" valign="top"><a id="aa8ce1fc8c74012dccf3add4e60b2636b"></a>  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_fixed_size_allocator_with_cleanup.html#aa8ce1fc8c74012dccf3add4e60b2636b">FixedSizeAllocatorWithCleanup</a> ()</td></tr> <tr class="memdesc:aa8ce1fc8c74012dccf3add4e60b2636b"><td class="mdescLeft"> </td><td class="mdescRight">Constructs a <a class="el" href="class_fixed_size_allocator_with_cleanup.html" title="Static secure memory block with cleanup.">FixedSizeAllocatorWithCleanup</a>. <br /></td></tr> <tr class="separator:aa8ce1fc8c74012dccf3add4e60b2636b"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a37fba3b04f010f580a97e05d7ef76199"><td class="memItemLeft" align="right" valign="top">pointer </td><td class="memItemRight" valign="bottom"><a class="el" href="class_fixed_size_allocator_with_cleanup.html#a37fba3b04f010f580a97e05d7ef76199">allocate</a> (size_type size)</td></tr> <tr class="memdesc:a37fba3b04f010f580a97e05d7ef76199"><td class="mdescLeft"> </td><td class="mdescRight">Allocates a block of memory. <a href="#a37fba3b04f010f580a97e05d7ef76199">More...</a><br /></td></tr> <tr class="separator:a37fba3b04f010f580a97e05d7ef76199"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a3b2bb2d6369a4d0f6c7e81e7c680b8e0"><td class="memItemLeft" align="right" valign="top">pointer </td><td class="memItemRight" valign="bottom"><a class="el" href="class_fixed_size_allocator_with_cleanup.html#a3b2bb2d6369a4d0f6c7e81e7c680b8e0">allocate</a> (size_type size, const void *hint)</td></tr> <tr class="memdesc:a3b2bb2d6369a4d0f6c7e81e7c680b8e0"><td class="mdescLeft"> </td><td class="mdescRight">Allocates a block of memory. <a href="#a3b2bb2d6369a4d0f6c7e81e7c680b8e0">More...</a><br /></td></tr> <tr class="separator:a3b2bb2d6369a4d0f6c7e81e7c680b8e0"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a174641db6c826668725ff9affee13478"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_fixed_size_allocator_with_cleanup.html#a174641db6c826668725ff9affee13478">deallocate</a> (void *ptr, size_type size)</td></tr> <tr class="memdesc:a174641db6c826668725ff9affee13478"><td class="mdescLeft"> </td><td class="mdescRight">Deallocates a block of memory. <a href="#a174641db6c826668725ff9affee13478">More...</a><br /></td></tr> <tr class="separator:a174641db6c826668725ff9affee13478"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad9c579e69409c773d2f5e9ab40027450"><td class="memItemLeft" align="right" valign="top">pointer </td><td class="memItemRight" valign="bottom"><a class="el" href="class_fixed_size_allocator_with_cleanup.html#ad9c579e69409c773d2f5e9ab40027450">reallocate</a> (pointer oldPtr, size_type oldSize, size_type newSize, bool preserve)</td></tr> <tr class="memdesc:ad9c579e69409c773d2f5e9ab40027450"><td class="mdescLeft"> </td><td class="mdescRight">Reallocates a block of memory. <a href="#ad9c579e69409c773d2f5e9ab40027450">More...</a><br /></td></tr> <tr class="separator:ad9c579e69409c773d2f5e9ab40027450"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a2b87955e281ef46eb2e9c7b6954e5508"><td class="memItemLeft" align="right" valign="top"><a id="a2b87955e281ef46eb2e9c7b6954e5508"></a> size_type </td><td class="memItemRight" valign="bottom"><b>max_size</b> () const</td></tr> <tr class="separator:a2b87955e281ef46eb2e9c7b6954e5508"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_methods_class_allocator_base"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_allocator_base')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="class_allocator_base.html">AllocatorBase< T ></a></td></tr> <tr class="memitem:a9d7ddf797b14ff38e335357759cf0b8b inherit pub_methods_class_allocator_base"><td class="memItemLeft" align="right" valign="top"><a id="a9d7ddf797b14ff38e335357759cf0b8b"></a> pointer </td><td class="memItemRight" valign="bottom"><b>address</b> (reference r) const</td></tr> <tr class="separator:a9d7ddf797b14ff38e335357759cf0b8b inherit pub_methods_class_allocator_base"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a731d970fd5b1adb9f87b4cfe81121d74 inherit pub_methods_class_allocator_base"><td class="memItemLeft" align="right" valign="top"><a id="a731d970fd5b1adb9f87b4cfe81121d74"></a> const_pointer </td><td class="memItemRight" valign="bottom"><b>address</b> (const_reference r) const</td></tr> <tr class="separator:a731d970fd5b1adb9f87b4cfe81121d74 inherit pub_methods_class_allocator_base"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a4816881defdf38aa120c70a03b7da903 inherit pub_methods_class_allocator_base"><td class="memItemLeft" align="right" valign="top"><a id="a4816881defdf38aa120c70a03b7da903"></a> void </td><td class="memItemRight" valign="bottom"><b>construct</b> (pointer p, const T &val)</td></tr> <tr class="separator:a4816881defdf38aa120c70a03b7da903 inherit pub_methods_class_allocator_base"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a740cc02314cba092678ab0545fa6967b inherit pub_methods_class_allocator_base"><td class="memItemLeft" align="right" valign="top"><a id="a740cc02314cba092678ab0545fa6967b"></a> void </td><td class="memItemRight" valign="bottom"><b>destroy</b> (pointer p)</td></tr> <tr class="separator:a740cc02314cba092678ab0545fa6967b inherit pub_methods_class_allocator_base"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ac2148e4d9df51a5b294eaf538e3f0074 inherit pub_methods_class_allocator_base"><td class="memItemLeft" align="right" valign="top">size_type </td><td class="memItemRight" valign="bottom"><a class="el" href="class_allocator_base.html#ac2148e4d9df51a5b294eaf538e3f0074">max_size</a> () const</td></tr> <tr class="memdesc:ac2148e4d9df51a5b294eaf538e3f0074 inherit pub_methods_class_allocator_base"><td class="mdescLeft"> </td><td class="mdescRight">Returns the maximum number of elements the allocator can provide. <a href="class_allocator_base.html#ac2148e4d9df51a5b294eaf538e3f0074">More...</a><br /></td></tr> <tr class="separator:ac2148e4d9df51a5b294eaf538e3f0074 inherit pub_methods_class_allocator_base"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a67c3e8ddd039b328cb9db2e7f325519a inherit pub_methods_class_allocator_base"><td class="memTemplParams" colspan="2">template<typename V , typename... Args> </td></tr> <tr class="memitem:a67c3e8ddd039b328cb9db2e7f325519a inherit pub_methods_class_allocator_base"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_allocator_base.html#a67c3e8ddd039b328cb9db2e7f325519a">construct</a> (V *ptr, Args &&... args)</td></tr> <tr class="memdesc:a67c3e8ddd039b328cb9db2e7f325519a inherit pub_methods_class_allocator_base"><td class="mdescLeft"> </td><td class="mdescRight">Constructs a new V using variadic arguments. <a href="class_allocator_base.html#a67c3e8ddd039b328cb9db2e7f325519a">More...</a><br /></td></tr> <tr class="separator:a67c3e8ddd039b328cb9db2e7f325519a inherit pub_methods_class_allocator_base"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ae9c6ff2132938f6afe935980a34f1b2d inherit pub_methods_class_allocator_base"><td class="memTemplParams" colspan="2">template<typename V > </td></tr> <tr class="memitem:ae9c6ff2132938f6afe935980a34f1b2d inherit pub_methods_class_allocator_base"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_allocator_base.html#ae9c6ff2132938f6afe935980a34f1b2d">destroy</a> (V *ptr)</td></tr> <tr class="memdesc:ae9c6ff2132938f6afe935980a34f1b2d inherit pub_methods_class_allocator_base"><td class="mdescLeft"> </td><td class="mdescRight">Destroys an V constructed with variadic arguments. <a href="class_allocator_base.html#ae9c6ff2132938f6afe935980a34f1b2d">More...</a><br /></td></tr> <tr class="separator:ae9c6ff2132938f6afe935980a34f1b2d inherit pub_methods_class_allocator_base"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a> Additional Inherited Members</h2></td></tr> <tr class="inherit_header pub_static_attribs_class_allocator_base"><td colspan="2" onclick="javascript:toggleInherit('pub_static_attribs_class_allocator_base')"><img src="closed.png" alt="-"/> Static Public Attributes inherited from <a class="el" href="class_allocator_base.html">AllocatorBase< T ></a></td></tr> <tr class="memitem:a88e45c0e5510a893595ed0073c99c3fb inherit pub_static_attribs_class_allocator_base"><td class="memItemLeft" align="right" valign="top">static const size_type </td><td class="memItemRight" valign="bottom"><a class="el" href="class_allocator_base.html#a88e45c0e5510a893595ed0073c99c3fb">ELEMS_MAX</a> = ...</td></tr> <tr class="memdesc:a88e45c0e5510a893595ed0073c99c3fb inherit pub_static_attribs_class_allocator_base"><td class="mdescLeft"> </td><td class="mdescRight">Returns the maximum number of elements the allocator can provide. <a href="class_allocator_base.html#a88e45c0e5510a893595ed0073c99c3fb">More...</a><br /></td></tr> <tr class="separator:a88e45c0e5510a893595ed0073c99c3fb inherit pub_static_attribs_class_allocator_base"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><h3>template<class T, size_t S, class A = NullAllocator<T>, bool T_Align16 = false><br /> class FixedSizeAllocatorWithCleanup< T, S, A, T_Align16 ></h3> <p>Static secure memory block with cleanup. </p> <dl class="tparams"><dt>Template Parameters</dt><dd> <table class="tparams"> <tr><td class="paramname">T</td><td>class or type </td></tr> <tr><td class="paramname">S</td><td>fixed-size of the stack-based memory block, in elements </td></tr> <tr><td class="paramname">T_Align16</td><td>boolean that determines whether allocations should be aligned on a 16-byte boundary</td></tr> </table> </dd> </dl> <p><a class="el" href="class_fixed_size_allocator_with_cleanup.html" title="Static secure memory block with cleanup.">FixedSizeAllocatorWithCleanup</a> provides a fixed-size, stack- based allocation at compile time. The class can grow its memory block at runtime if a suitable allocator is available. If size grows beyond S and a suitable allocator is available, then the statically allocated array is obsoleted. </p><dl class="section note"><dt>Note</dt><dd>This allocator can't be used with standard collections because they require that all objects of the same allocator type are equivalent. </dd></dl> <p class="definition">Definition at line <a class="el" href="secblock_8h_source.html#l00319">319</a> of file <a class="el" href="secblock_8h_source.html">secblock.h</a>.</p> </div><h2 class="groupheader">Member Function Documentation</h2> <a id="a37fba3b04f010f580a97e05d7ef76199"></a> <h2 class="memtitle"><span class="permalink"><a href="#a37fba3b04f010f580a97e05d7ef76199">◆ </a></span>allocate() <span class="overload">[1/2]</span></h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T, size_t S, class A = NullAllocator<T>, bool T_Align16 = false> </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">pointer <a class="el" href="class_fixed_size_allocator_with_cleanup.html">FixedSizeAllocatorWithCleanup</a>< T, S, A, T_Align16 >::allocate </td> <td>(</td> <td class="paramtype">size_type </td> <td class="paramname"><em>size</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Allocates a block of memory. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">size</td><td>the count elements in the memory block</td></tr> </table> </dd> </dl> <p><a class="el" href="class_fixed_size_allocator_with_cleanup.html" title="Static secure memory block with cleanup.">FixedSizeAllocatorWithCleanup</a> provides a fixed-size, stack-based allocation at compile time. If size is less than or equal to <code>S</code>, then a pointer to the static array is returned.</p> <p>The class can grow its memory block at runtime if a suitable allocator is available. If size grows beyond S and a suitable allocator is available, then the statically allocated array is obsoleted. If a suitable allocator is not available, as with a <a class="el" href="class_null_allocator.html" title="NULL allocator.">NullAllocator</a>, then the function returns NULL and a runtime error eventually occurs. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_fixed_size_allocator_with_cleanup.html#ad9c579e69409c773d2f5e9ab40027450" title="Reallocates a block of memory.">reallocate()</a>, <a class="el" href="class_sec_block_with_hint.html" title="Stack-based SecBlock that grows into the heap.">SecBlockWithHint</a> </dd></dl> <p class="definition">Definition at line <a class="el" href="secblock_8h_source.html#l00339">339</a> of file <a class="el" href="secblock_8h_source.html">secblock.h</a>.</p> </div> </div> <a id="a3b2bb2d6369a4d0f6c7e81e7c680b8e0"></a> <h2 class="memtitle"><span class="permalink"><a href="#a3b2bb2d6369a4d0f6c7e81e7c680b8e0">◆ </a></span>allocate() <span class="overload">[2/2]</span></h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T, size_t S, class A = NullAllocator<T>, bool T_Align16 = false> </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">pointer <a class="el" href="class_fixed_size_allocator_with_cleanup.html">FixedSizeAllocatorWithCleanup</a>< T, S, A, T_Align16 >::allocate </td> <td>(</td> <td class="paramtype">size_type </td> <td class="paramname"><em>size</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const void * </td> <td class="paramname"><em>hint</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Allocates a block of memory. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">size</td><td>the count elements in the memory block </td></tr> <tr><td class="paramname">hint</td><td>an unused hint</td></tr> </table> </dd> </dl> <p><a class="el" href="class_fixed_size_allocator_with_cleanup.html" title="Static secure memory block with cleanup.">FixedSizeAllocatorWithCleanup</a> provides a fixed-size, stack- based allocation at compile time. If size is less than or equal to S, then a pointer to the static array is returned.</p> <p>The class can grow its memory block at runtime if a suitable allocator is available. If size grows beyond S and a suitable allocator is available, then the statically allocated array is obsoleted. If a suitable allocator is not available, as with a <a class="el" href="class_null_allocator.html" title="NULL allocator.">NullAllocator</a>, then the function returns NULL and a runtime error eventually occurs. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_fixed_size_allocator_with_cleanup.html#ad9c579e69409c773d2f5e9ab40027450" title="Reallocates a block of memory.">reallocate()</a>, <a class="el" href="class_sec_block_with_hint.html" title="Stack-based SecBlock that grows into the heap.">SecBlockWithHint</a> </dd></dl> <p class="definition">Definition at line <a class="el" href="secblock_8h_source.html#l00365">365</a> of file <a class="el" href="secblock_8h_source.html">secblock.h</a>.</p> </div> </div> <a id="a174641db6c826668725ff9affee13478"></a> <h2 class="memtitle"><span class="permalink"><a href="#a174641db6c826668725ff9affee13478">◆ </a></span>deallocate()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T, size_t S, class A = NullAllocator<T>, bool T_Align16 = false> </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void <a class="el" href="class_fixed_size_allocator_with_cleanup.html">FixedSizeAllocatorWithCleanup</a>< T, S, A, T_Align16 >::deallocate </td> <td>(</td> <td class="paramtype">void * </td> <td class="paramname"><em>ptr</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_type </td> <td class="paramname"><em>size</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Deallocates a block of memory. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ptr</td><td>a pointer to the memory block to deallocate </td></tr> <tr><td class="paramname">size</td><td>the count elements in the memory block</td></tr> </table> </dd> </dl> <p>The memory block is wiped or zeroized before deallocation. If the statically allocated memory block is active, then no additional actions are taken after the wipe.</p> <p>If a dynamic memory block is active, then the pointer and size are passed to the allocator for deallocation. </p> <p class="definition">Definition at line <a class="el" href="secblock_8h_source.html#l00384">384</a> of file <a class="el" href="secblock_8h_source.html">secblock.h</a>.</p> </div> </div> <a id="ad9c579e69409c773d2f5e9ab40027450"></a> <h2 class="memtitle"><span class="permalink"><a href="#ad9c579e69409c773d2f5e9ab40027450">◆ </a></span>reallocate()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T, size_t S, class A = NullAllocator<T>, bool T_Align16 = false> </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">pointer <a class="el" href="class_fixed_size_allocator_with_cleanup.html">FixedSizeAllocatorWithCleanup</a>< T, S, A, T_Align16 >::reallocate </td> <td>(</td> <td class="paramtype">pointer </td> <td class="paramname"><em>oldPtr</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_type </td> <td class="paramname"><em>oldSize</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_type </td> <td class="paramname"><em>newSize</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool </td> <td class="paramname"><em>preserve</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Reallocates a block of memory. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">oldPtr</td><td>the previous allocation </td></tr> <tr><td class="paramname">oldSize</td><td>the size of the previous allocation </td></tr> <tr><td class="paramname">newSize</td><td>the new, requested size </td></tr> <tr><td class="paramname">preserve</td><td>flag that indicates if the old allocation should be preserved </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>pointer to the new memory block</dd></dl> <p><a class="el" href="class_fixed_size_allocator_with_cleanup.html" title="Static secure memory block with cleanup.">FixedSizeAllocatorWithCleanup</a> provides a fixed-size, stack- based allocation at compile time. If size is less than or equal to S, then a pointer to the static array is returned.</p> <p>The class can grow its memory block at runtime if a suitable allocator is available. If size grows beyond S and a suitable allocator is available, then the statically allocated array is obsoleted. If a suitable allocator is not available, as with a <a class="el" href="class_null_allocator.html" title="NULL allocator.">NullAllocator</a>, then the function returns NULL and a runtime error eventually occurs. </p><dl class="section note"><dt>Note</dt><dd>size is the count of elements, and not the number of bytes. </dd></dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="class_fixed_size_allocator_with_cleanup.html#ad9c579e69409c773d2f5e9ab40027450" title="Reallocates a block of memory.">reallocate()</a>, <a class="el" href="class_sec_block_with_hint.html" title="Stack-based SecBlock that grows into the heap.">SecBlockWithHint</a> </dd></dl> <p class="definition">Definition at line <a class="el" href="secblock_8h_source.html#l00414">414</a> of file <a class="el" href="secblock_8h_source.html">secblock.h</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="secblock_8h_source.html">secblock.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Wed Nov 27 2019 15:04:16 for Crypto++ by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.15 </small></address> </body> </html>