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

📄 arwinmemorypool_t.h

📁 wangchuanDll.rar 网络传输的DLL 源代码
💻 H
字号:
// ArWinMemoryPool_T.h: interface for the ArWinMemoryPool_T class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_ARWINMEMORYPOOL_T_H__E6885609_9DA7_44AE_BC2B_9DDB31BC7FCA__INCLUDED_)
#define AFX_ARWINMEMORYPOOL_T_H__E6885609_9DA7_44AE_BC2B_9DDB31BC7FCA__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "ArMemoryPool_T.h"
#include "ArMemoryList_T.h"
#include <map>

//----------------------------------------------------------------------------

class ArWinMemoryPool_T : public ArMemoryPool_T  
{
public:
	struct ArMemSet_T
	{
		int iMemSize;
		int iInitialNum;
	};
	void*   __stdcall Allocate(int iSize);	
	bool    __stdcall Free(void* pData);
    bool    __stdcall GetPoolInfo(ArMemoryPoolInfo_T& Info);
	bool    __stdcall Destroy();

	ArWinMemoryPool_T(int iListNum = 4);
    ~ArWinMemoryPool_T();
private:

    enum {MAXLISTNUM = 10};
	ArMemoryList_T*		m_MemList[MAXLISTNUM];
	ArMemSet_T			m_MemSet[MAXLISTNUM];
    int  m_iListNum;
    std::map<void*, ArBlockInfo_T>  m_MemTable;
    HANDLE              m_Event;
    CRITICAL_SECTION    m_csPoolAllocate;
	CRITICAL_SECTION	m_csPoolFree;


	bool FindRange(int iSize, int& index);
    bool IsAllMemoryFree(void);

    static  unsigned int  __stdcall  DestroyObj(void* pParent);
};

#endif // !defined(AFX_ARWINMEMORYPOOL_T_H__E6885609_9DA7_44AE_BC2B_9DDB31BC7FCA__INCLUDED_)

⌨️ 快捷键说明

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