mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Add CStdMemAlloc::GetSize() to SDK
Returns the size of the buffer allocated with MemAllocSingleton()->Alloc() etc.
This commit is contained in:
parent
20d1fabd0c
commit
babbcbe6d5
@ -22,6 +22,12 @@ public:
|
||||
const int index = 5;
|
||||
CallVFunc<void>(index, this, pMem);
|
||||
}
|
||||
template<typename T>
|
||||
size_t GetSize(T* pMem)
|
||||
{
|
||||
const int index = 6;
|
||||
return CallVFunc<size_t>(index, this, pMem);
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -331,8 +331,7 @@ public:
|
||||
#ifdef REMEMBER_ALLOC_SIZE_FOR_VALGRIND
|
||||
return m_nCurAllocSize;
|
||||
#else
|
||||
//return (m_pMemory) ? MemAllocSingleton()->GetSize(m_pMemory) : 0; // FIXME: reverse vftable and get 'GetSize'
|
||||
return 0;
|
||||
return (m_pMemory) ? MemAllocSingleton()->GetSize(m_pMemory) : 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user