mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Tier0: add template inline for FindPatternSIMD
This allows for directly setting a function pointer without double casting it, and significantly reduce code verbosity.
This commit is contained in:
parent
05352d9d17
commit
053a1ca9e0
@ -28,6 +28,15 @@ public:
|
||||
void LoadSections();
|
||||
|
||||
CMemory FindPatternSIMD(const char* szPattern, const ModuleSections_t* moduleSection = nullptr) const;
|
||||
|
||||
template<typename T>
|
||||
inline void FindPatternSIMD(const char* szPattern,
|
||||
T*& pMemPtrOut, const ModuleSections_t* moduleSection = nullptr) const
|
||||
{
|
||||
CMemory mem = FindPatternSIMD(szPattern, moduleSection);
|
||||
pMemPtrOut = mem.RCast<T*>();
|
||||
}
|
||||
|
||||
CMemory FindString(const char* szString, const ptrdiff_t occurrence = 1, bool nullTerminator = false) const;
|
||||
CMemory FindStringReadOnly(const char* szString, bool nullTerminator) const;
|
||||
CMemory FindFreeDataPage(const size_t nSize) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user