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
@@ -56,7 +56,7 @@ void daE_HM_HIO_c::genMessage(JORMContext* ctx) {
int daE_HM_c::CreateHeap() {
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("E_HM", 17);
JUT_ASSERT(0xbf, modelData != NULL);
mAnm_p = new mDoExt_McaMorfSO(modelData, NULL, NULL,
mAnm_p = JKR_NEW mDoExt_McaMorfSO(modelData, NULL, NULL,
(J3DAnmTransform*)dComIfG_getObjectRes("E_HM", 13), 2, 1.0f, 0, -1, &mSound,
0x80000, 0x11000284);
if (mAnm_p == NULL || mAnm_p->getModel() == NULL) {
@@ -65,7 +65,7 @@ int daE_HM_c::CreateHeap() {
J3DModel* model = mAnm_p->getModel();
mpBrkAnm = new mDoExt_brkAnm();
mpBrkAnm = JKR_NEW mDoExt_brkAnm();
if (mpBrkAnm == NULL) {
return 0;
}
@@ -74,7 +74,7 @@ int daE_HM_c::CreateHeap() {
return 0;
}
mpBtkAnm = new mDoExt_btkAnm();
mpBtkAnm = JKR_NEW mDoExt_btkAnm();
if (mpBtkAnm == NULL) {
return 0;
}