diff --git a/core/vm/sp_vm_engine.cpp b/core/vm/sp_vm_engine.cpp index 9438c034..4790a930 100644 --- a/core/vm/sp_vm_engine.cpp +++ b/core/vm/sp_vm_engine.cpp @@ -59,6 +59,8 @@ using namespace SourcePawn; +SourceHook::CPageAlloc g_ExeMemory(16); + #define ERROR_MESSAGE_MAX 25 static const char *g_ErrorMsgTable[] = { @@ -100,7 +102,7 @@ const char *GetSourcePawnErrorMessage(int error) return g_ErrorMsgTable[error]; } -SourcePawnEngine::SourcePawnEngine() : m_ExeMemory(16) +SourcePawnEngine::SourcePawnEngine() { m_pDebugHook = NULL; m_CallStack = NULL; @@ -149,22 +151,22 @@ void *SourcePawnEngine::ExecAlloc(size_t size) void *SourcePawnEngine::AllocatePageMemory(size_t size) { - return m_ExeMemory.Alloc(size); + return g_ExeMemory.Alloc(size); } void SourcePawnEngine::SetReadExecute(void *ptr) { - m_ExeMemory.SetRE(ptr); + g_ExeMemory.SetRE(ptr); } void SourcePawnEngine::SetReadWrite(void *ptr) { - m_ExeMemory.SetRW(ptr); + g_ExeMemory.SetRW(ptr); } void SourcePawnEngine::FreePageMemory(void *ptr) { - m_ExeMemory.Free(ptr); + g_ExeMemory.Free(ptr); } void SourcePawnEngine::ExecFree(void *address) diff --git a/core/vm/sp_vm_engine.h b/core/vm/sp_vm_engine.h index e5b4294c..a14b8b45 100644 --- a/core/vm/sp_vm_engine.h +++ b/core/vm/sp_vm_engine.h @@ -35,8 +35,6 @@ #include "sp_vm_api.h" #include "sp_vm_function.h" -class SourceHook::CPageAlloc; - struct TracedCall { uint32_t cip; @@ -116,7 +114,6 @@ private: TracedCall *m_FreedCalls; TracedCall *m_CallStack; unsigned int m_CurChain; - SourceHook::CPageAlloc m_ExeMemory; //CFunction *m_pFreeFuncs; };