CThreadSafeMemoryPool::~CThreadSafeMemoryPool
0x0008c140 · 289 bytes · __thiscall
_ZN21CThreadSafeMemoryPoolD2Ev
Decompiled
undefined (1 param)
/* CThreadSafeMemoryPool::~CThreadSafeMemoryPool() */
void __thiscall CThreadSafeMemoryPool::~CThreadSafeMemoryPool(CThreadSafeMemoryPool *this)
{
int iVar1;
int *piVar2;
char cVar3;
int iVar4;
iVar4 = ThreadGetCurrentId();
LOCK();
*(int *)(this + 0x20) = *(int *)(this + 0x20) + 1;
UNLOCK();
if ((0 < *(int *)(this + 0x1c)) ||
(((*(int *)(this + 0x18) != 0 && (iVar4 != *(int *)(this + 0x18))) ||
(cVar3 = ThreadInterlockedAssignIf64(this + 0x18,iVar4,0,0,0), cVar3 == '\0')))) {
CThreadSpinRWLock::SpinLockForWrite((uint)(this + 0x18));
}
if (0 < *(int *)(this + 0x34)) {
iVar4 = 0;
do {
iVar1 = iVar4 * 8;
iVar4 = iVar4 + 1;
free(*(void **)(*(int *)(this + 0x28) + iVar1));
} while (iVar4 < *(int *)(this + 0x34));
}
piVar2 = *(int **)(this + 0x3c);
if (piVar2 != (int *)0x0) {
do {
if (*piVar2 == 0) break;
cVar3 = ThreadInterlockedAssignIf64(piVar2,0,piVar2[1] & 0xffff0000,*piVar2,piVar2[1]);
} while (cVar3 == '\0');
operator_delete(piVar2);
}
CThreadSpinRWLock::UnlockWrite();
*(undefined4 *)(this + 0x34) = 0;
CUtlMemory<CThreadSafeMemoryPool::BlockSet_t,int>::Purge
((CUtlMemory<CThreadSafeMemoryPool::BlockSet_t,int> *)(this + 0x28));
*(undefined4 *)(this + 0x38) = *(undefined4 *)(this + 0x28);
CUtlMemory<CThreadSafeMemoryPool::BlockSet_t,int>::Purge
((CUtlMemory<CThreadSafeMemoryPool::BlockSet_t,int> *)(this + 0x28));
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.