From 6bdc8f24263b148007a1bff4f9f3a4e4308c12cc Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Mon, 8 Jan 2024 22:59:35 +0100 Subject: [PATCH] Tier1: enable CMemoryStack and fix compile errors in debug Define missing MemAlloc_* inlines. --- src/public/tier0/imemalloc.h | 9 +++++++++ src/tier1/CMakeLists.txt | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/public/tier0/imemalloc.h b/src/public/tier0/imemalloc.h index a33b72e9..5caa290c 100644 --- a/src/public/tier0/imemalloc.h +++ b/src/public/tier0/imemalloc.h @@ -10,6 +10,15 @@ #ifndef TIER0_IMEMALLOC_H #define TIER0_IMEMALLOC_H +inline void* MemAlloc_Alloc(size_t nSize, const char* pFileName = NULL, int nLine = 0) { return malloc(nSize); } +inline void MemAlloc_Free(void* ptr, const char* pFileName = NULL, int nLine = 0) { free(ptr); } + +inline void* MemAlloc_AllocAligned(size_t size, size_t align) { return _aligned_malloc(size, align); } +inline void* MemAlloc_AllocAlignedFileLine(size_t size, size_t align, const char* pszFile = NULL, int nLine = 0) { return _aligned_malloc(size, align); } +inline void MemAlloc_FreeAligned(void* pMemBlock, const char* pszFile = NULL, int nLine = 0) { free(pMemBlock); } + +//----------------------------------------------------------------------------- + /// This interface class is used to let the mem_dump command retrieve /// information about memory allocations outside of the heap. It is currently /// used by CMemoryStack to report on its allocations. diff --git a/src/tier1/CMakeLists.txt b/src/tier1/CMakeLists.txt index 85b75857..51a8f685 100644 --- a/src/tier1/CMakeLists.txt +++ b/src/tier1/CMakeLists.txt @@ -19,7 +19,7 @@ add_sources( SOURCE_GROUP "Utility" "utlstring.cpp" "characterset.cpp" "mempool.cpp" - #"memstack.cpp" + "memstack.cpp" ) add_sources( SOURCE_GROUP "Private"