⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 memlib.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 HTML
📖 第 1 页 / 共 2 页
字号:
This routine allocates a buffer of <i>size</i> bytes from the system memorypartition.  Additionally, it insures that the allocated bufferbegins on a page boundary.  Page sizes are architecture-dependent.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>A pointer to the newly allocated block, or NULL if the buffer could not beallocated or the memory management unit (MMU) support library has not beeninitialized.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_memLib_PAGE_SIZE_UNAVAILABLE</b></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./memLib.html#top">memLib</a></b><hr><a name="memPartRealloc"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>memPartRealloc(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>memPartRealloc(&nbsp;)</strong> - reallocate a block of memory in a specified partition</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void *memPartRealloc    (    PART_ID  partId,          /* partition ID */    char *   pBlock,          /* block to be reallocated */    unsigned nBytes           /* new block size in bytes */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine changes the size of a specified block of memory and returns apointer to the new block.  The contents that fit inside the new size (orold size if smaller) remain unchanged.  The memory alignment of the newblock is not guaranteed to be the same as the original block.<p>If <i>pBlock</i> is NULL, this call is equivalent to <b><a href="./memPartLib.html#memPartAlloc">memPartAlloc</a>(&nbsp;)</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>A pointer to the new block of memory, or NULL if the call fails.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_smObjLib_NOT_INITIALIZED</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./memLib.html#top">memLib</a></b>, <b><a href="./smMemLib.html#top">smMemLib</a></b><hr><a name="memPartFindMax"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>memPartFindMax(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>memPartFindMax(&nbsp;)</strong> - find the size of the largest available free block</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int memPartFindMax    (    PART_ID partId            /* partition ID */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine searches for the largest block in the memory partition freelist and returns its size.<p></blockquote><h4>RETURNS</h4><blockquote><p>The size, in bytes, of the largest available block.<p></blockquote><h4>ERRNO</h4><blockquote><p><b>S_smObjLib_NOT_INITIALIZED</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./memLib.html#top">memLib</a></b>, <b><a href="./smMemLib.html#top">smMemLib</a></b><hr><a name="memOptionsSet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>memOptionsSet(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>memOptionsSet(&nbsp;)</strong> - set the debug options for the system memory partition</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void memOptionsSet    (    unsigned options          /* options for system partition */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets the debug options for the system memory partition.Two kinds of errors are detected:  attempts to allocate more memory thanis available, and bad blocks found when memory is freed.  In both cases,the following options can be selected for actions to be taken when the erroris detected:  (1) return the error status, (2) log an error message andreturn the error status, or (3) log an error message and suspend thecalling task.<p>These options are discussed in detail in the library manualentry for <b><a href="./memLib.html#top">memLib</a></b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./memLib.html#top">memLib</a></b>, <b><a href="./memLib.html#memPartOptionsSet">memPartOptionsSet</a>(&nbsp;)</b><hr><a name="calloc"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>calloc(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>calloc(&nbsp;)</strong> - allocate space for an array (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void *calloc    (    size_t elemNum,           /* number of elements */    size_t elemSize           /* size of elements */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine allocates a block of memory for an array that contains<i>elemNum</i> elements of size <i>elemSize</i>.  This space is initialized tozeros.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>A pointer to the block, or NULL if the call fails.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./memLib.html#top">memLib</a></b>, <i>American National Standard for Information Systems -</i><i>Programming Language - C, ANSI X3.159-1989: General Utilities (<b>stdlib.h</b>)</i><hr><a name="realloc"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>realloc(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>realloc(&nbsp;)</strong> - reallocate a block of memory (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void *realloc    (    void * pBlock,            /* block to reallocate */    size_t newSize            /* new block size */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine changes the size of a specified block of memory and returns apointer to the new block of memory.  The contents that fit inside the newsize (or old size if smaller) remain unchanged.  The memory alignment ofthe new block is not guaranteed to be the same as the original block.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>A pointer to the new block of memory, or NULL if the call fails.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./memLib.html#top">memLib</a></b>, <i>American National Standard for Information Systems -</i><i>Programming Language - C, ANSI X3.159-1989: General Utilities (<b>stdlib.h</b>)</i><hr><a name="cfree"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>cfree(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>cfree(&nbsp;)</strong> - free a block of memory</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS cfree    (    char * pBlock             /* pointer to block of memory to free */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns to the free memory pool a block of memory previously allocated with <b><a href="./memLib.html#calloc">calloc</a>(&nbsp;)</b>.<p>It is an error to free a memory block that was not previously allocated.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the the block is invalid.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./memLib.html#top">memLib</a></b><hr><a name="memFindMax"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>memFindMax(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>memFindMax(&nbsp;)</strong> - find the largest free block in the system memory partition</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int memFindMax (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine searches for the largest block in the system memory partitionfree list and returns its size.<p></blockquote><h4>RETURNS</h4><blockquote><p>The size, in bytes, of the largest available block.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./memLib.html#top">memLib</a></b>, <b><a href="./memLib.html#memPartFindMax">memPartFindMax</a>(&nbsp;)</b></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -