aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/memalloc.cpp
diff options
context:
space:
mode:
authorp0358 <p0358@users.noreply.github.com>2021-12-31 22:46:45 +0100
committerp0358 <p0358@users.noreply.github.com>2021-12-31 22:46:45 +0100
commit9b13df7bc6f4c09c3fdab27cd51fe76d30b756b8 (patch)
treed273fbc7942b46497f056fd9c68b8b21e6d19fee /NorthstarDedicatedTest/memalloc.cpp
parentdcba96bcc4b02639e859b0dcdc863391cb54684f (diff)
downloadNorthstarLauncher-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.cpp6
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++;