Html程序  |  150行  |  6.15 KB

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>OsclMemAllocator class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.18 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Data Structures</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Data Fields</a> &nbsp; <a class="qindex" href="globals.html">Globals</a> &nbsp; </center>
<hr><h1>OsclMemAllocator Class Reference<br>
<small>
[<a class="el" href="group__osclmemory.html">OSCL Memory</a>,&nbsp;<a class="el" href="group__osclmemory.html">OSCL Memory</a>]</small>
</h1><code>#include &lt;<a class="el" href="oscl__mem_8h-source.html">oscl_mem.h</a>&gt;</code>
<p>
<p>Inheritance diagram for OsclMemAllocator:
<p><center><img src="classOsclMemAllocator.png" usemap="#OsclMemAllocator_map" border="0" alt=""></center>
<map name="OsclMemAllocator_map">
<area href="classOscl__DefAlloc.html" alt="Oscl_DefAlloc" shape="rect" coords="63,56,179,80">
<area href="classOscl__Alloc.html" alt="Oscl_Alloc" shape="rect" coords="0,0,116,24">
<area href="classOscl__Dealloc.html" alt="Oscl_Dealloc" shape="rect" coords="126,0,242,24">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="group__osclbase.html#a25">OsclAny</a> *&nbsp;</td><td valign=bottom><a class="el" href="classOsclMemAllocator.html#a0">allocate</a> (const uint32 n)</td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="group__osclbase.html#a25">OsclAny</a> *&nbsp;</td><td valign=bottom><a class="el" href="classOsclMemAllocator.html#a1">allocate_fl</a> (const uint32 n, const char *file_name, const int line_num)</td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classOsclMemAllocator.html#a2">deallocate</a> (<a class="el" href="group__osclbase.html#a25">OsclAny</a> *p)</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A simple allocator class. Configurable as to whether this goes through the memory manager or not. 
<p>
<hr><h2>Member Function Documentation</h2>
<a name="a0" doxytag="OsclMemAllocator::allocate"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="group__osclbase.html#a25">OsclAny</a>* OsclMemAllocator::allocate </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const uint32&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp; <em>n</em>          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [inline, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
This API throws an exception when malloc returns NULL. n must be greater than 0.
<p>
<dl compact><dt><b>Returns: </b></dt><dd>
pointer (or Leave with OsclErrNoMemory ) </dl>
<p>
Implements <a class="el" href="classOscl__DefAlloc.html#a0">Oscl_DefAlloc</a>.    </td>
  </tr>
</table>
<a name="a1" doxytag="OsclMemAllocator::allocate_fl"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="group__osclbase.html#a25">OsclAny</a>* OsclMemAllocator::allocate_fl </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const uint32&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>n</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>file_name</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>const int&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>line_num</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Reimplemented from <a class="el" href="classOscl__DefAlloc.html#a1">Oscl_DefAlloc</a>.    </td>
  </tr>
</table>
<a name="a2" doxytag="OsclMemAllocator::deallocate"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void OsclMemAllocator::deallocate </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="group__osclbase.html#a25">OsclAny</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp; <em>p</em>          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [inline, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Implements <a class="el" href="classOscl__DefAlloc.html#a2">Oscl_DefAlloc</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="oscl__mem_8h-source.html">oscl_mem.h</a></ul>
<hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small>
<address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small>
</small></address>
</body>
</html>