CThreadSafeMemoryPool::PrintStats
0x0008bd60 · 278 bytes · __thiscall
_ZN21CThreadSafeMemoryPool10PrintStatsEv
Decompiled
undefined (1 param)
/* CThreadSafeMemoryPool::PrintStats() */
void __thiscall CThreadSafeMemoryPool::PrintStats(CThreadSafeMemoryPool *this)
{
undefined4 uVar1;
undefined4 uVar2;
char cVar3;
int iVar4;
undefined4 uVar5;
undefined4 uVar6;
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));
}
uVar1 = *(undefined4 *)(this + 0xc);
/* try { // try from 0008bdcc to 0008be19 has its CatchHandler @ 0008be82 */
uVar5 = V_pretifymem((float)(*(uint *)(this + 0x10) >> 0x10) * 65536.0 +
(float)(*(uint *)(this + 0x10) & 0xffff),2,true);
uVar2 = *(undefined4 *)(this + 0x34);
uVar6 = V_pretifymem((float)*(int *)(this + 4),2,true);
Msg("Block size: %s\tAlloc\'d: %d\tNum blobs: %d (%s)\n",uVar6,uVar1,uVar2,uVar5);
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.