CThreadSafeMemoryPool::Clear
0x0008bb60 · 133 bytes · __thiscall
_ZN21CThreadSafeMemoryPool5ClearEv
Decompiled
undefined (1 param)
/* CThreadSafeMemoryPool::Clear() */
void __thiscall CThreadSafeMemoryPool::Clear(CThreadSafeMemoryPool *this)
{
char cVar1;
int iVar2;
iVar2 = ThreadGetCurrentId();
LOCK();
*(int *)(this + 0x20) = *(int *)(this + 0x20) + 1;
UNLOCK();
if ((0 < *(int *)(this + 0x1c)) ||
(((*(int *)(this + 0x18) != 0 && (iVar2 != *(int *)(this + 0x18))) ||
(cVar1 = ThreadInterlockedAssignIf64(this + 0x18,iVar2,0,0,0), cVar1 == '\0')))) {
CThreadSpinRWLock::SpinLockForWrite((uint)(this + 0x18));
}
/* try { // try from 0008bb93 to 0008bb97 has its CatchHandler @ 0008bbf2 */
ClearNoLock(this);
CThreadSpinRWLock::UnlockWrite();
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.