diff options
author | p0358 <p0358@users.noreply.github.com> | 2021-12-31 22:46:45 +0100 |
---|---|---|
committer | p0358 <p0358@users.noreply.github.com> | 2021-12-31 22:46:45 +0100 |
commit | 9b13df7bc6f4c09c3fdab27cd51fe76d30b756b8 (patch) | |
tree | d273fbc7942b46497f056fd9c68b8b21e6d19fee /NorthstarDedicatedTest/memalloc.cpp | |
parent | dcba96bcc4b02639e859b0dcdc863391cb54684f (diff) | |
download | NorthstarLauncher-9b13df7bc6f4c09c3fdab27cd51fe76d30b756b8.tar.gz NorthstarLauncher-9b13df7bc6f4c09c3fdab27cd51fe76d30b756b8.zip |
some post-merge changes combined with my local changes
Diffstat (limited to 'NorthstarDedicatedTest/memalloc.cpp')
-rw-r--r-- | NorthstarDedicatedTest/memalloc.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/NorthstarDedicatedTest/memalloc.cpp b/NorthstarDedicatedTest/memalloc.cpp index 86215e3f..1b9eaae8 100644 --- a/NorthstarDedicatedTest/memalloc.cpp +++ b/NorthstarDedicatedTest/memalloc.cpp @@ -23,13 +23,15 @@ extern "C" void _free_base(void* p) { if (!g_pMemAllocSingleton) { + spdlog::warn("Trying to free something before g_pMemAllocSingleton was ready, this should never happen"); InitialiseTier0GameUtilFunctions(GetModuleHandleA("tier0.dll")); } g_pMemAllocSingleton->m_vtable->Free(g_pMemAllocSingleton, p); } -extern "C" void* _realloc_base(void* oldPtr, size_t size) { +extern "C" void* _realloc_base(void* oldPtr, size_t size) +{ if (!g_pMemAllocSingleton) { InitialiseTier0GameUtilFunctions(GetModuleHandleA("tier0.dll")); @@ -56,7 +58,7 @@ extern "C" char* _strdup_base(const char* src) while (src[len]) len++; - str = (char*)(_malloc_base(len + 1)); + str = reinterpret_cast<char*>(_malloc_base(len + 1)); p = str; while (*src) *p++ = *src++; |