📄 memorypool.h
字号:
// MemoryPool.h: interface for the MemoryPool class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_MEMORYPOOL_H__13C325E1_DC2D_45A3_AC5F_5B0CDEF30B93__INCLUDED_)
#define AFX_MEMORYPOOL_H__13C325E1_DC2D_45A3_AC5F_5B0CDEF30B93__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include<queue>
#include<iostream>
using namespace std;
class MemoryPool
{
public:
void ReturnMsgBlk(float* msg);
float* GetMsgBlk();
void ReturnDataBlk(float* data);
float* GetDataBlk();
MemoryPool(long datasize,long datablksize,long msgsize, int msgblksize);
virtual ~MemoryPool();
private:
float* data_head;
float* message_head;
long pool_size;
long data_size;
long data_blksize;
long msg_size;
int msg_blksize;
queue<float*> freedata_list;
queue<float*> freemsg_list;
queue<float*> usedata_list;
queue<float*> usemsg_list;
};
#endif // !defined(AFX_MEMORYPOOL_H__13C325E1_DC2D_45A3_AC5F_5B0CDEF30B93__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -