CThreadSafeMultiMemoryPool::CThreadSafeMultiMemoryPool
0x00075340 · 513 bytes · __thiscall
_ZN26CThreadSafeMultiMemoryPoolC2EPKNS_15MemPoolConfig_tEii
Decompiled
undefined (4 params)
/* CThreadSafeMultiMemoryPool::CThreadSafeMultiMemoryPool(CThreadSafeMultiMemoryPool::MemPoolConfig_t
const*, int, int) */
void __thiscall
CThreadSafeMultiMemoryPool::CThreadSafeMultiMemoryPool
(CThreadSafeMultiMemoryPool *this,MemPoolConfig_t *param_1,int param_2,int param_3)
{
uint *puVar1;
CThreadSafeMemoryPool *this_00;
uint uVar2;
int iVar3;
int iVar4;
int iVar5;
uint uVar6;
uint uVar7;
int local_30;
CThreadSafeMemoryPool *local_24;
uint local_20;
local_30 = 0;
*(undefined2 *)(this + 0x3e) = 0;
*(undefined2 *)(this + 0x42) = 0xffff;
*(undefined4 *)this = 0;
*(undefined4 *)(this + 4) = 0;
*(undefined4 *)(this + 8) = 0;
*(undefined4 *)(this + 0xc) = 0;
*(undefined4 *)(this + 0x10) = 0;
*(undefined4 *)(this + 0x18) = 0;
*(undefined4 *)(this + 0x1c) = 0;
*(undefined4 *)(this + 0x20) = 0;
*(undefined4 *)(this + 0x24) = 0;
*(undefined4 *)(this + 0x28) = 0;
*(undefined4 *)(this + 0x30) = 0;
*(undefined4 *)(this + 0x34) = 0;
*(undefined4 *)(this + 0x38) = 0;
*(undefined2 *)(this + 0x3c) = 0xffff;
*(undefined2 *)(this + 0x40) = 0xffff;
*(undefined4 *)(this + 0x44) = 0;
*(undefined4 *)(this + 0x48) = 0;
*(undefined4 *)(this + 0x4c) = 0;
*(undefined4 *)(this + 0x50) = 0;
*(code **)(this + 0x2c) = CDefOps<void*>::LessFunc;
if (param_2 < 1) {
uVar2 = *(uint *)(this + 0x14);
iVar4 = 0;
}
else {
do {
/* try { // try from 0007540f to 00075413 has its CatchHandler @ 000755bf */
this_00 = operator_new(0x40);
/* try { // try from 00075430 to 00075434 has its CatchHandler @ 00075541 */
CThreadSafeMemoryPool::CThreadSafeMemoryPool
(this_00,*(int *)param_1 + 4,*(int *)(param_1 + 4),param_3);
local_20 = *(uint *)param_1;
local_24 = this_00;
/* try { // try from 0007544e to 00075531 has its CatchHandler @ 000755bf */
CUtlVector<CThreadSafeMultiMemoryPool::MemPoolRecord_t,CUtlMemory<CThreadSafeMultiMemoryPool::MemPoolRecord_t,int>>
::InsertBefore((CUtlVector<CThreadSafeMultiMemoryPool::MemPoolRecord_t,CUtlMemory<CThreadSafeMultiMemoryPool::MemPoolRecord_t,int>>
*)this,*(int *)(this + 0xc),(MemPoolRecord_t *)&local_24);
uVar2 = *(uint *)(this + 0x14);
if (*(uint *)(this + 0x14) <= local_20) {
uVar2 = local_20;
}
param_1 = param_1 + 8;
local_30 = local_30 + 1;
*(uint *)(this + 0x14) = uVar2;
} while (local_30 != param_2);
iVar4 = *(int *)(this + 0x24);
}
uVar2 = uVar2 >> 5;
if (uVar2 != 0) {
CUtlVector<CThreadSafeMultiMemoryPool::MemPoolRecord_t*,CUtlMemory<CThreadSafeMultiMemoryPool::MemPoolRecord_t*,int>>
::GrowVector((CUtlVector<CThreadSafeMultiMemoryPool::MemPoolRecord_t*,CUtlMemory<CThreadSafeMultiMemoryPool::MemPoolRecord_t*,int>>
*)(this + 0x18),uVar2);
iVar3 = (*(int *)(this + 0x24) - iVar4) - uVar2;
if (iVar3 < 1) {
if (uVar2 != 0) {
LAB_000754a9:
uVar7 = 0;
do {
while( true ) {
uVar6 = uVar7 * 0x20 + 1;
if (0 < *(int *)(this + 0xc)) break;
LAB_000754e1:
uVar7 = uVar7 + 1;
if (uVar2 == uVar7) {
return;
}
}
iVar4 = *(int *)this;
if (*(uint *)(iVar4 + 4) < uVar6) {
iVar5 = 0;
iVar3 = iVar4;
do {
iVar4 = iVar3 + 8;
iVar5 = iVar5 + 1;
if (iVar5 == *(int *)(this + 0xc)) goto LAB_000754e1;
puVar1 = (uint *)(iVar3 + 0xc);
iVar3 = iVar4;
} while (*puVar1 < uVar6);
}
*(int *)(*(int *)(this + 0x18) + uVar7 * 4) = iVar4;
uVar7 = uVar7 + 1;
if (uVar2 == uVar7) {
return;
}
} while( true );
}
}
else if (uVar2 != 0) {
_V_memmove((void *)(*(int *)(this + 0x18) + (iVar4 + uVar2) * 4),
(void *)(*(int *)(this + 0x18) + iVar4 * 4),iVar3 * 4);
goto LAB_000754a9;
}
}
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.