DragonNest/Common/Utility/MemPool.cpp
Cussrro 47f7895977 Revert "修复编码问题"
This reverts commit 9e69c01767.
2024-12-21 10:04:04 +08:00

32 lines
No EOL
640 B
C++

#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; //디버거가 연결중인상태라면 lfh disable
ULONG heapFragValue = 2;
if (HeapSetInformation(m_hLfhHeap, HeapCompatibilityInformation, &heapFragValue, sizeof(heapFragValue)) == 0)
return false;
return true;
}