L L4D2node

CThreadSafeMultiMemoryPool::PrintStats

0x00074bb0 · 263 bytes · __thiscall

_ZN26CThreadSafeMultiMemoryPool10PrintStatsEv

Decompiled

undefined (1 param)

/* CThreadSafeMultiMemoryPool::PrintStats() */

uint __thiscall CThreadSafeMultiMemoryPool::PrintStats(CThreadSafeMultiMemoryPool *this)

{
  CThreadSafeMultiMemoryPool *pCVar1;
  uint uVar2;
  uint uVar3;
  int iVar4;
  int iVar5;
  
  iVar5 = 0;
  if (0 < *(int *)(this + 0xc)) {
    do {
      iVar4 = iVar5 * 8;
      iVar5 = iVar5 + 1;
      CThreadSafeMemoryPool::PrintStats(*(CThreadSafeMemoryPool **)(*(int *)this + iVar4));
    } while (iVar5 < *(int *)(this + 0xc));
  }
  uVar3 = ThreadGetCurrentId();
  pCVar1 = this + 0x48;
  if (uVar3 != *(uint *)(this + 0x48)) {
    LOCK();
    uVar2 = *(uint *)pCVar1;
    if (uVar2 == 0) {
      *(uint *)pCVar1 = uVar3;
    }
    UNLOCK();
    if (uVar2 != 0) {
      CThreadFastMutex::Lock((uint)pCVar1,uVar3);
      goto LAB_00074bff;
    }
  }
  *(int *)(this + 0x4c) = *(int *)(this + 0x4c) + 1;
LAB_00074bff:
  uVar3 = *(uint *)(this + 0x34);
  iVar5 = 0;
  if ((short)uVar3 != 0) {
    do {
      while ((((int)uVar3 <= iVar5 || (*(ushort *)(this + 0x42) < (ushort)iVar5)) ||
             (CUtlRBTree<CUtlMap<void*,CThreadSafeMultiMemoryPool::RawAllocation_t,unsigned_short>::Node_t,unsigned_short,CUtlMap<void*,CThreadSafeMultiMemoryPool::RawAllocation_t,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<void*,CThreadSafeMultiMemoryPool::RawAllocation_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
              ::Links(unsigned_short)::s_Sentinel != '\0'))) {
        iVar5 = iVar5 + 1;
        if ((int)(uVar3 & 0xffff) <= iVar5) goto LAB_00074c50;
      }
      iVar4 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<void*,CThreadSafeMultiMemoryPool::RawAllocation_t,unsigned_short>::Node_t,unsigned_short,CUtlMap<void*,CThreadSafeMultiMemoryPool::RawAllocation_t,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<void*,CThreadSafeMultiMemoryPool::RawAllocation_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                   ::Links(unsigned_short)::s_Sentinel);
      if (iVar4 == 0) {
        uVar3 = *(uint *)(this + 0x34);
      }
      else {
        CUtlRBTree<CUtlMap<void*,CThreadSafeMultiMemoryPool::RawAllocation_t,unsigned_short>::Node_t,unsigned_short,CUtlMap<void*,CThreadSafeMultiMemoryPool::RawAllocation_t,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<void*,CThreadSafeMultiMemoryPool::RawAllocation_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
        ::Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_000d2862 = 0xffff;
        DAT_000d2864 = 0xffff;
        __cxa_guard_release(&CUtlRBTree<CUtlMap<void*,CThreadSafeMultiMemoryPool::RawAllocation_t,unsigned_short>::Node_t,unsigned_short,CUtlMap<void*,CThreadSafeMultiMemoryPool::RawAllocation_t,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<void*,CThreadSafeMultiMemoryPool::RawAllocation_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                             ::Links(unsigned_short)::s_Sentinel);
        uVar3 = *(uint *)(this + 0x34);
      }
      iVar5 = iVar5 + 1;
    } while (iVar5 < (int)(uVar3 & 0xffff));
  }
LAB_00074c50:
  *(int *)(this + 0x4c) = *(int *)(this + 0x4c) + -1;
  uVar3 = *(uint *)(this + 0x4c);
  if (uVar3 == 0) {
    LOCK();
    uVar3 = *(uint *)pCVar1;
    *(uint *)pCVar1 = 0;
    UNLOCK();
  }
  return uVar3;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)