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;
|
const int index = 5;
|
||||||
CallVFunc<void>(index, this, pMem);
|
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
|
#ifdef REMEMBER_ALLOC_SIZE_FOR_VALGRIND
|
||||||
return m_nCurAllocSize;
|
return m_nCurAllocSize;
|
||||||
#else
|
#else
|
||||||
//return (m_pMemory) ? MemAllocSingleton()->GetSize(m_pMemory) : 0; // FIXME: reverse vftable and get 'GetSize'
|
return (m_pMemory) ? MemAllocSingleton()->GetSize(m_pMemory) : 0;
|
||||||
return 0;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user