From 4f7280ab4c1073a46e61afd4d42d24413055e146 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 18 Jun 2023 01:25:49 +0200 Subject: [PATCH] Make inline These type of functions should always be inline. --- r5dev/tier0/memstd.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/r5dev/tier0/memstd.h b/r5dev/tier0/memstd.h index 4b21c2b1..1d27b76b 100644 --- a/r5dev/tier0/memstd.h +++ b/r5dev/tier0/memstd.h @@ -1,41 +1,41 @@ #ifndef MEMSTD_H #define MEMSTD_H -void* R_malloc(size_t nSize); -void R_free(void* pBlock); -void* R_realloc(void* pBlock, size_t nSize); -char* R_strdup(const char* pString); -void* R_calloc(size_t nCount, size_t nSize); +extern "C" void* R_malloc(size_t nSize); +extern "C" void R_free(void* pBlock); +extern "C" void* R_realloc(void* pBlock, size_t nSize); +extern "C" char* R_strdup(const char* pString); +extern "C" void* R_calloc(size_t nCount, size_t nSize); class IMemAlloc { public: template - T* Alloc(size_t nSize) + inline T* Alloc(size_t nSize) { const static int index = 1; return CallVFunc(index, this, nSize); } template - T* Realloc(T* pMem, size_t nSize) + inline T* Realloc(T* pMem, size_t nSize) { const static int index = 3; return CallVFunc(index, this, pMem, nSize); } template - void FreeDbg(T* pMem, const char* pFileName, int nLine) + inline void FreeDbg(T* pMem, const char* pFileName, int nLine) { const static int index = 4; // Same as free, but takes debug parameters. CallVFunc(index, this, pMem, pFileName, nLine); } template - void Free(T* pMem) + inline void Free(T* pMem) { const static int index = 5; CallVFunc(index, this, pMem); } template - size_t GetSize(T* pMem) + inline size_t GetSize(T* pMem) { const static int index = 6; return CallVFunc(index, this, pMem);