smemorychunk.h

来自「用C++编写的一个对系统内存的管理」· C头文件 代码 · 共 37 行

H
37
字号
/******************
SMemoryChunk.h
******************/

/*!\file SMemoryChunk.h
 * \brief Contains the "SMemoryChunk" Type-definition.
 */

#ifndef __INC_SMemoryChunk_h__
#define __INC_SMemoryChunk_h__

#include "IMemoryBlock.h"

namespace MemPool
{

/*!\class SMemoryChunk
 * \brief Memory Chunk Struct
 *
 * This struct will hold (and manage) the actual allocated Memory.
 * Every MemoryChunk will point to a MemoryBlock, and another SMemoryChunk,
 * thus creating a linked-list of MemoryChunks.
 */
typedef struct SMemoryChunk
{
  TByte *Data ;				//!< The actual Data
  std::size_t DataSize ;	//!< Size of the "Data"-Block
  std::size_t UsedSize ;	//!< actual used Size
  bool IsAllocationChunk ;	//!< true, when this MemoryChunks Points to a "Data"-Block which can be deallocated via "free()"
  SMemoryChunk *Next ;		//!< Pointer to the Next MemoryChunk in the List (may be NULL)

} SMemoryChunk ;

}

#endif /* __INC_SMemoryChunk_h__ */

⌨️ 快捷键说明

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