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
+4 -4
View File
@@ -39,7 +39,7 @@ COutFont_c::COutFont_c(u8 param_0) {
field_0x242 = param_0;
for (int i = 0; i < 35; i++) {
mpOfs[i] = new COutFontSet_c();
mpOfs[i] = JKR_NEW COutFontSet_c();
}
for (int i = 0; i < 70; i++) {
@@ -56,7 +56,7 @@ COutFont_c::COutFont_c(u8 param_0) {
COutFont_c::~COutFont_c() {
for (int i = 0; i < 35; i++) {
delete mpOfs[i];
JKR_DELETE(mpOfs[i]);
mpOfs[i] = NULL;
}
@@ -65,7 +65,7 @@ COutFont_c::~COutFont_c() {
for (int i = 0; i < 70; i++) {
if (mpPane[i] != NULL) {
delete mpPane[i];
JKR_DELETE(mpPane[i]);
mpPane[i] = NULL;
}
}
@@ -95,7 +95,7 @@ void COutFont_c::createPane() {
img = (ResTIMG*)dComIfGp_getMain2DArchive()->getResource('TIMG', getBtiName(i));
}
mpPane[i] = new J2DPicture(img);
mpPane[i] = JKR_NEW J2DPicture(img);
switch (i) {
case 0:
mpPane[i]->setBlackWhite(JUtility::TColor(255, 255, 255, 0),