L L4D2node

Memory_Init

0x00240300 · 184 bytes · unknown

_Z11Memory_Initv

Decompiled

undefined (0 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* Memory_Init() */

void Memory_Init(void)

{
  char cVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  
  uVar4 = 0x3c00000;
  while (cVar1 = CMemoryStack::Init((CMemoryStack *)&g_HunkMemoryStack,uVar4,0x10000,0x2000000,0x10)
        , cVar1 == '\0') {
    uVar3 = (int)uVar4 / 2;
    Warning("Unable to allocate %d MB of memory, trying %d MB instead\n",uVar4,uVar3);
    uVar4 = uVar3;
    if ((int)uVar3 < 0x3000000) {
      Error("Failed to allocate minimum memory requirement for game (%d MB)\n",0x30);
    }
  }
  iVar2 = DAT_003a1548 - (g_HunkMemoryStack - _DAT_003f2cb0);
  if (iVar2 < 0x100000) {
    iVar2 = 0x100000;
  }
  (**(code **)(*g_pDataCache + 0x14))(g_pDataCache,iVar2);
  return;
}

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)