DragonNest/Common/Utility/MemPool.cpp

32 lines
1.3 KiB
C++
Raw Normal View History

2024-12-20 16:56:44 +08:00
<EFBFBD><EFBFBD>
#include "Stdafx.h"
#include "MemPool.h"
#ifdef _DEBUG
#define new new(_NORMAL_BLOCK,__FILE__,__LINE__)
#endif
CLfhHeap::~CLfhHeap()
{
HeapDestroy(m_hLfhHeap);
m_hLfhHeap = NULL;
}
CLfhHeap * CLfhHeap::GetInstance()
{
static CLfhHeap s;
return &s;
}
bool CLfhHeap::InitPool()
{
if (m_hLfhHeap) return true;
m_hLfhHeap = HeapCreate(0, 0, 0);
if (m_hLfhHeap == NULL) return false;
if (IsDebuggerPresent()) return true; //<EFBFBD><EFBFBD><EFBFBD>p<EFBFBD><EFBFBD> <EFBFBD>Ű<EFBFBD><EFBFBD>x<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>|<EFBFBD>t<EFBFBD> lfh disable
ULONG heapFragValue = 2;
if (HeapSetInformation(m_hLfhHeap, HeapCompatibilityInformation, &heapFragValue, sizeof(heapFragValue)) == 0)
return false;
return true;
}