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
+8 -8
View File
@@ -12,28 +12,28 @@ dKantera_icon_c::dKantera_icon_c() {
}
dKantera_icon_c::~dKantera_icon_c() {
delete mpKanteraIcon->getScreen();
delete mpKanteraIcon;
JKR_DELETE(mpKanteraIcon->getScreen());
JKR_DELETE(mpKanteraIcon);
mpKanteraIcon = NULL;
delete mpParent;
JKR_DELETE(mpParent);
mpParent = NULL;
delete mpGauge;
JKR_DELETE(mpGauge);
mpGauge = NULL;
}
void dKantera_icon_c::initiate() {
mpKanteraIcon = new dDlst_KanteraIcon_c();
mpKanteraIcon = JKR_NEW dDlst_KanteraIcon_c();
J2DScreen* scrn = new J2DScreen();
J2DScreen* scrn = JKR_NEW J2DScreen();
scrn->setPriority("zelda_kantera_icon_mater.blo", 0x20000, dComIfGp_getMain2DArchive());
dPaneClass_showNullPane(scrn);
mpKanteraIcon->setScreen(scrn);
mpParent = new CPaneMgr(scrn, MULTI_CHAR('kan_m_n'), 2, NULL);
mpParent = JKR_NEW CPaneMgr(scrn, MULTI_CHAR('kan_m_n'), 2, NULL);
mpGauge = new CPaneMgr(scrn, MULTI_CHAR('yellow_m'), 0, NULL);
mpGauge = JKR_NEW CPaneMgr(scrn, MULTI_CHAR('yellow_m'), 0, NULL);
}
void dKantera_icon_c::setAlphaRate(f32 alphaRate) {