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
@@ -489,11 +489,11 @@ void dMenu_FmapMap_c::_create(u16 i_texWidth, u16 i_texHeight, u16 param_2, u16
void dMenu_FmapMap_c::_delete() {
if (mResTIMG != NULL) {
delete mResTIMG;
JKR_DELETE(mResTIMG);
mResTIMG = NULL;
}
if (mMapImage_p != NULL) {
delete[] mMapImage_p;
JKR_DELETE_ARRAY(mMapImage_p);
mMapImage_p = NULL;
}
}
@@ -659,9 +659,9 @@ void dMenu_FmapMap_c::setTexture(u16 i_width, u16 i_height, u16 param_2, u16 par
mMapImage_p = NULL;
mResTIMG = NULL;
int size = GXGetTexBufferSize(i_width, i_height, GX_TF_C8, 0, 0);
mMapImage_p = new (0x20) u8[size];
mMapImage_p = JKR_NEW_ARGS (0x20) u8[size];
init(mMapImage_p, i_width, i_height, param_2, param_3);
mResTIMG = new (0x20) ResTIMG();
mResTIMG = JKR_NEW_ARGS (0x20) ResTIMG();
makeResTIMG(mResTIMG, i_width, i_height, mMapImage_p, (u8*)m_palette, 0x1b);
}