文件名称:内存缓冲区, C/C++ 用处很多
文件大小:5KB
文件格式:C
更新时间:2013-08-31 05:58:13
内存缓冲区
内存缓冲区的例子 , C/C++ void * MYAPI MemoryBufferAlloc( int nBufSize,BOOL bAutoClear) { int nTotalSize = 0 ; MEMORY_BUFFER *pMem = NULL ; nTotalSize = sizeof(MEMORY_BUFFER) + nBufSize ; pMem = (MEMORY_BUFFER *)_MEM_ALLOC(nTotalSize); if( pMem != NULL ) { pMem->nTotalSize = nTotalSize ; pMem->iFirst = 0 ; pMem->nDataLen = 0 ; pMem->nBufSize = nBufSize ; pMem->bAutoClear = bAutoClear ; pMem->buf = ((char *)pMem) + sizeof(MEMORY_BUFFER) ;