📄 tgtmem.html
字号:
<html><head><!-- /vobs/wpwr/docs/tornado-api/tgtint/tgtmem.html - generated by refgen from tgtmem.c --> <title> tgtmem </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>Tornado API Reference : Target Server Internal Routines</i></a></p></blockquote><h1>tgtmem</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>tgtmem</strong> - target memory manager </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./tgtmem.html#tgtMemMalloc">tgtMemMalloc</a></i>( )</b> - allocate a block of memory from the system memory partition<br><b><i><a href="./tgtmem.html#tgtMemFree">tgtMemFree</a></i>( )</b> - free a block of memory<br><b><i><a href="./tgtmem.html#tgtMemCalloc">tgtMemCalloc</a></i>( )</b> - allocate a block of memory for an array<br><b><i><a href="./tgtmem.html#tgtMemRealloc">tgtMemRealloc</a></i>( )</b> - reallocate a block of memory<br><b><i><a href="./tgtmem.html#tgtMemValloc">tgtMemValloc</a></i>( )</b> - allocate memory on a page boundary <br><b><i><a href="./tgtmem.html#tgtMemRead">tgtMemRead</a></i>( )</b> - read a block of target memory<br><b><i><a href="./tgtmem.html#tgtMemWidthRead">tgtMemWidthRead</a></i>( )</b> - read a block of target memory<br><b><i><a href="./tgtmem.html#tgtMemSet">tgtMemSet</a></i>( )</b> - set a memory area to a particular value<br><b><i><a href="./tgtmem.html#tgtMemWriteByte">tgtMemWriteByte</a></i>( )</b> - write a byte to the target<br><b><i><a href="./tgtmem.html#tgtMemWriteShort">tgtMemWriteShort</a></i>( )</b> - write a <b>short</b> to the target<br><b><i><a href="./tgtmem.html#tgtMemWriteInt">tgtMemWriteInt</a></i>( )</b> - write an <b>int</b> to the target<br><b><i><a href="./tgtmem.html#tgtMemWrite">tgtMemWrite</a></i>( )</b> - write a block to the target<br><b><i><a href="./tgtmem.html#tgtMemWidthWrite">tgtMemWidthWrite</a></i>( )</b> - write a block to the target<br><b><i><a href="./tgtmem.html#tgtMemMove">tgtMemMove</a></i>( )</b> - move a block on the target<br><b><i><a href="./tgtmem.html#tgtMemCacheSet">tgtMemCacheSet</a></i>( )</b> - give a block of target memory an attribute<br><b><i><a href="./tgtmem.html#tgtMemCacheGet">tgtMemCacheGet</a></i>( )</b> - get a block descriptor for target memory<br><b><i><a href="./tgtmem.html#tgtMemAlignGet">tgtMemAlignGet</a></i>( )</b> - return the alignment value for the target memory<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides core facilities for managing the allocation ofblocks of memory from the target agent's pool of memory. This libraryconsists of two sets of routines: the first comprises a generalfacility for the target memory cache and for the allocation anddeallocation of blocks from the target; the second comprises ageneral facility for read/write operations.<p>The allocation of memory, typically using <b><i><a href="./tgtmem.html#tgtMemMalloc">tgtMemMalloc</a></i>( )</b>, is donewith a first-fit algorithm. Adjacent blocks of memory are coalesced whenthey are freed.<p></blockquote><h4>CAVEATS</h4><blockquote><p>Architectures have various alignment constraints. To provide optimalperformance, <b><i><a href="./tgtmem.html#tgtMemMalloc">tgtMemMalloc</a></i>( )</b> returns a pointer to a buffer having theappropriate alignment for the target architecture in use.<p></blockquote><h4>INCLUDE FILE</h4><blockquote><p><b>tgtmem.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./tgtmem.html#top">tgtmem</a></b><hr><a name="tgtMemMalloc"></a><p align=right><a href="rtnIndex.html"><i>Target Server Internal Routines : Routines</i></a></p></blockquote><h1><i>tgtMemMalloc</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>tgtMemMalloc</i>( )</strong> - allocate a block of memory from the system memory partition</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>REMPTR tgtMemMalloc ( size_t nBytes /* number of bytes to allocate */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine allocates a block of memory from the free list. The size ofthe block is equal to or greater than <i>nBytes</i> and it matches the target'salignment requirements.<p></blockquote><h4>RETURNS</h4><blockquote><p>A pointer to the allocated block of memory or a NULL pointer ifan error occurs.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./tgtmem.html#top">tgtmem</a></b>, <i>API Programmer's Guide: Object Module Loader </i><hr><a name="tgtMemFree"></a><p align=right><a href="rtnIndex.html"><i>Target Server Internal Routines : Routines</i></a></p></blockquote><h1><i>tgtMemFree</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>tgtMemFree</i>( )</strong> - free a block of memory</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void tgtMemFree ( REMPTR ptr /* pointer to block of memory to free */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns a block of memory, previously allocated with<b><i><a href="./tgtmem.html#tgtMemMalloc">tgtMemMalloc</a></i>( )</b>, <b><i><a href="./tgtmem.html#tgtMemCalloc">tgtMemCalloc</a></i>( )</b>, or <b><i><a href="./tgtmem.html#tgtMemValloc">tgtMemValloc</a></i>( )</b>, to the free memory pool.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./tgtmem.html#top">tgtmem</a></b>, <i>API Programmer's Guide: Object Module Loader </i><hr><a name="tgtMemCalloc"></a><p align=right><a href="rtnIndex.html"><i>Target Server Internal Routines : Routines</i></a></p></blockquote><h1><i>tgtMemCalloc</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>tgtMemCalloc</i>( )</strong> - allocate a block of memory for an array</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>REMPTR tgtMemCalloc ( 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 matches the target alignment requirements and is initially filled with zeros.<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="./tgtmem.html#top">tgtmem</a></b>, <i>API Programmer's Guide: Object Module Loader </i><hr><a name="tgtMemRealloc"></a><p align=right><a href="rtnIndex.html"><i>Target Server Internal Routines : Routines</i></a></p></blockquote><h1><i>tgtMemRealloc</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>tgtMemRealloc</i>( )</strong> - reallocate a block of memory</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>REMPTR tgtMemRealloc ( REMPTR 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 andreturns a pointer to the new block of memory. The contents of theold memory block that fit inside the new size (or the old size ifthe new block is smaller) remain unchanged. The memory alignment ofthe new block is not guaranteed to be the same as the originalblock.<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="./tgtmem.html#top">tgtmem</a></b>, <i>API Programmer's Guide: Object Module Loader </i><hr><a name="tgtMemValloc"></a><p align=right><a href="rtnIndex.html"><i>Target Server Internal Routines : Routines</i></a></p></blockquote><h1><i>tgtMemValloc</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>tgtMemValloc</i>( )</strong> - allocate memory on a page boundary </p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>REMPTR tgtMemValloc ( unsigned size /* number of bytes to allocate */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine allocates a buffer of <i>size</i> bytes from the systemmemory partition. Additionally, it insures that the allocatedbuffer begins on a page boundary. Page sizes depend on the targetarchitecture.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>A pointer to the newly allocated block or NULL if the buffer cannot beallocated or the memory management unit (MMU) support library has not beeninitialized.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./tgtmem.html#top">tgtmem</a></b>, <i>API Programmer's Guide: Object Module Loader </i><hr><a name="tgtMemRead"></a><p align=right><a href="rtnIndex.html"><i>Target Server Internal Routines : Routines</i></a></p></blockquote><h1><i>tgtMemRead</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>tgtMemRead</i>( )</strong> - read a block of target memory</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS tgtMemRead ( REMPTR source, void * destination, int nBytes )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine reads a block of memory from the target. Actual operationdepends on the cache memory attribute of the destination block.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR if the block of memory does not exist or cannot be read.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./tgtmem.html#top">tgtmem</a></b>, <b><i><a href="./tgtmem.html#tgtMemCacheSet">tgtMemCacheSet</a></i>( )</b>, <i>API Programmer's Guide: Object Module Loader </i><hr><a name="tgtMemWidthRead"></a><p align=right><a href="rtnIndex.html"><i>Target Server Internal Routines : Routines</i></a></p></blockquote><h1><i>tgtMemWidthRead</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>tgtMemWidthRead</i>( )</strong> - read a block of target memory</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS tgtMemWidthRead ( REMPTR source, void * destination, int nBytes, int width )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine reads a block of memory from the target. Actual operationdepends on the cache memory attribute of the destination block.The memory is read <i>width</i> bytes by <i>width</i> bytes.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR if the block of memory does not exist or cannot be read.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./tgtmem.html#top">tgtmem</a></b>, <b><i><a href="./tgtmem.html#tgtMemCacheSet">tgtMemCacheSet</a></i>( )</b>, <i>API Programmer's Guide: Object Module Loader </i><hr><a name="tgtMemSet"></a><p align=right><a href="rtnIndex.html"><i>Target Server Internal Routines : Routines</i></a></p></blockquote><h1><i>tgtMemSet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>tgtMemSet</i>( )</strong> - set a memory area to a particular value</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS tgtMemSet ( REMPTR destination, /* buffer to be set */ int nBytes, /* number of bytes in buffer */ int value /* set value */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine fills a block of target memory with the specified value. Actualoperation depends on the cache memory attribute of the destination block.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR if the operation fails.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./tgtmem.html#top">tgtmem</a></b>, <b><i><a href="./tgtmem.html#tgtMemCacheSet">tgtMemCacheSet</a></i>( )</b>, <i>API Programmer's Guide: Object Module Loader </i><hr><a name="tgtMemWriteByte"></a><p align=right><a href="rtnIndex.html"><i>Target Server Internal Routines : Routines</i></a></p></blockquote><h1><i>tgtMemWriteByte</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>tgtMemWriteByte</i>( )</strong> - write a byte to the target</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS tgtMemWriteByte ( REMPTR destination, char value )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine writes a byte to the target. Actual operation depends
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -