?? a00073.html
字號(hào):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Sklmp4 MPEG-4 library: SKL_MEM_I class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.4 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div><h1>SKL_MEM_I Class Reference</h1><code>#include <skl.h></code><p><a href="a00002.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="a00094.html#a17">SKL_ANY</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a00073.html#a2">New</a> (const size_t Size)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a00073.html#a3">Delete</a> (const <a class="el" href="a00094.html#a17">SKL_ANY</a> p, size_t Size)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a00073.html#a4">Realloc</a> (<a class="el" href="a00094.html#a17">SKL_ANY</a> &Ptr, const size_t Size, const size_t Old_Size=0)</td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Instance of this class should provide interface for memory allocation and disallocation. The default implementation uses malloc() / free() low-level calls.<br> A new-with-placement operator is defined, taking the memory pool as placement data. You can then use: new (Mem) MY_CLASS to allocate MY_CLASS on the SKL_MEM_I *Mem memory pool. <br> For convenience, a default global static instance of SKL_MEM_I is available as: SKL_MEM_I *SKL_MEM.<br> <p><hr><h2>Member Function Documentation</h2><a class="anchor" name="a3" doxytag="SKL_MEM_I::Delete" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual void SKL_MEM_I::Delete </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="a00094.html#a17">SKL_ANY</a> </td> <td class="mdname" nowrap> <em>p</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>size_t </td> <td class="mdname" nowrap> <em>Size</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This function should disallocate the memory segment pointed to by the 'p' parameter, and of size 'Size'. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign=top><em>p</em> </td><td>Pointer to the memory segment. This pointer should have been obtained by a call to <a class="el" href="a00073.html#a2">New()</a> member function. </td></tr> <tr><td valign=top><em>Size</em> </td><td>size of the memory to be freed. This size *must* match the size that was passed to the corresponding <a class="el" href="a00073.html#a2">New()</a> call as argument. </td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a2" doxytag="SKL_MEM_I::New" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual <a class="el" href="a00094.html#a17">SKL_ANY</a> SKL_MEM_I::New </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const size_t </td> <td class="mdname1" valign="top" nowrap> <em>Size</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This function should return a pointer to a freshly allocation memory segment of at least 'Size' size. It returns 0 if allocation was not possible. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign=top><em>Size</em> </td><td>the desired size to be allocated. </td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a4" doxytag="SKL_MEM_I::Realloc" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void SKL_MEM_I::Realloc </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="a00094.html#a17">SKL_ANY</a> & </td> <td class="mdname" nowrap> <em>Ptr</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const size_t </td> <td class="mdname" nowrap> <em>Size</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const size_t </td> <td class="mdname" nowrap> <em>Old_Size</em> = 0</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This function re-allocates, without copying its content, a memory segment of size 'Old_Size' referenced by 'Ptr'. The new size is passed a 'Size' argument. </td> </tr></table><hr>The documentation for this class was generated from the following file:<ul><li><a class="el" href="a00094.html">skl.h</a></ul><hr size="1"><address style="align: right;"><small>Generated on Tue Nov 4 16:28:34 2003 for Sklmp4 MPEG-4 library by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 > </a>1.3.4 </small></address></body></html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -