CMake fixes

This commit is contained in:
IlyaShurupov 2023-10-27 15:33:33 +03:00 committed by Ilya Shurupov
parent fa72355799
commit f6ba86aff8
19 changed files with 82 additions and 168 deletions

View file

@ -5,6 +5,8 @@
#include "PrivateConfig.hpp"
#include <malloc.h>
using namespace tp;
#if not defined(MEM_DEBUG)
@ -61,7 +63,7 @@ HeapAlloc::~HeapAlloc() {
DEBUG_BREAK("Destruction of not freed Allocator")
#ifdef MEM_STACK_TRACE
// TODO : log leaks and free them up
// TODO : log leaks and free them up
#endif
}
}

View file

@ -18,6 +18,9 @@ using namespace tp;
void* HeapAllocGlobal::allocate(ualni aBlockSize) { return malloc(aBlockSize); }
void HeapAllocGlobal::deallocate(void* aPtr) { free(aPtr); }
HeapAllocGlobal::~HeapAllocGlobal() = default;
bool HeapAllocGlobal::checkLeaks() { return false; }
void HeapAllocGlobal::startIgnore() {}
void HeapAllocGlobal::stopIgnore() {}
#else
@ -95,7 +98,7 @@ ALLOCATE:
}
mEntry = head;
// 3) Trace the stack
// 3) Trace the stack
#ifdef MEM_STACK_TRACE
head->mCallStack = gCSCapture->getSnapshot();
#endif
@ -146,7 +149,7 @@ void HeapAllocGlobal::deallocate(void* aPtr) {
ASSERT(!"Allocated Block Wrap Corrupted!")
}
// 4) clear data
// 4) clear data
#ifdef MEM_CLEAR_ON_ALLOC
memSetVal(data, head->mBlockSize, CLEAR_DEALLOC_VAL);
#endif