CUtlMemory<UtlLinkedListElem_t<COverlayMgr::RenderQueueHead_t,unsigned_short>,unsigned_short>::Grow
0x001d5ab0 · 196 bytes · __thiscall
_ZN10CUtlMemoryI19UtlLinkedListElem_tIN11COverlayMgr17RenderQueueHead_tEtEtE4GrowEi
Decompiled
undefined (2 params)
/* CUtlMemory<UtlLinkedListElem_t<COverlayMgr::RenderQueueHead_t, unsigned short>, unsigned
short>::Grow(int) */
void __thiscall
CUtlMemory<UtlLinkedListElem_t<COverlayMgr::RenderQueueHead_t,unsigned_short>,unsigned_short>::Grow
(CUtlMemory<UtlLinkedListElem_t<COverlayMgr::RenderQueueHead_t,unsigned_short>,unsigned_short>
*this,int param_1)
{
int iVar1;
uint uVar2;
void *pvVar3;
uint uVar4;
uint uVar5;
iVar1 = *(int *)(this + 8);
if (iVar1 < 0) {
return;
}
uVar2 = *(uint *)(this + 4);
uVar4 = param_1 + uVar2;
if (iVar1 == 0) {
if (uVar2 == 0) {
uVar2 = 1;
}
for (; (int)uVar2 < (int)uVar4; uVar2 = uVar2 * 2) {
}
}
else {
uVar2 = ((int)(uVar4 - 1) / iVar1 + 1) * iVar1;
}
if ((int)(uVar2 & 0xffff) < (int)uVar4) {
if ((short)uVar2 == 0) {
uVar2 = uVar2 - 1;
if (0xffff < (int)uVar4) {
return;
}
}
else {
uVar5 = uVar4 & 0xffff;
if (uVar5 != uVar4) {
return;
}
if ((int)(uVar2 & 0xffff) < (int)uVar4) {
do {
uVar2 = (int)(uVar2 + uVar5) / 2;
} while ((uVar2 & 0xffff) < uVar5);
}
}
}
*(uint *)(this + 4) = uVar2;
if (*(void **)this != (void *)0x0) {
pvVar3 = realloc(*(void **)this,uVar2 * 0x30);
*(void **)this = pvVar3;
return;
}
pvVar3 = malloc(uVar2 * 0x30);
*(void **)this = pvVar3;
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.