Isolate JKRHeap operator overloads

Fixes #25

This isolates the JKRHeap operator new/delete overloads. Every single new/delete site in the code has been replaced with a macro.

Sadly for new[] and delete[] we have to keep global operators. The global new[] just allocates into malloc() however, and delete[] goes into free() if it's not in a JKRHeap. So that's fine.
This commit is contained in:
PJB3005
2026-02-27 23:11:59 +01:00
parent 2204ad0813
commit 038ef4216f
634 changed files with 3451 additions and 3350 deletions
+3 -3
View File
@@ -102,8 +102,8 @@ static int daObjTHASHI_Delete(daObjTHASHI_c* i_this) {
// stripped function to move dtor weak ordering
static void strippedFunc3(cXyz* a, csXyz* b) {
delete[] b;
delete[] a;
JKR_DELETE_ARRAY(b);
JKR_DELETE_ARRAY(a);
}
void daObjTHASHI_c::setBaseMtx() {
@@ -194,7 +194,7 @@ int daObjTHASHI_c::CreateHeap() {
return FALSE;
}
u32 ind = dComIfG_getObjctResName2Index(l_arcName, "S_thashi01.dzb");
unk5A0 = new dBgW();
unk5A0 = JKR_NEW dBgW();
if (unk5A0 != NULL && !unk5A0->Set((cBgD_t*)dComIfG_getObjectRes(l_arcName, ind), 1, &mBgMtx)) {
if (m_set_func != NULL) {