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
+5 -4
View File
@@ -1,13 +1,14 @@
#ifndef J2DANIMATION_H
#define J2DANIMATION_H
#include "JSystem/JMath/JMath.h"
#include "JSystem/J3DGraphAnimator/J3DAnimation.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JMath/JMath.h"
#include "JSystem/JUtility/JUTPalette.h"
typedef struct _GXColor GXColor;
typedef struct _GXColorS10 GXColorS10;
class J2DScreen;
class JUTPalette;
struct ResTIMG;
enum J2DAnmKind {
@@ -286,7 +287,7 @@ public:
mPalette = NULL;
}
~J2DAnmTexPatternTIMGPointer() {
delete mPalette;
JKR_DELETE(mPalette);
}
/* 0x0 */ ResTIMG* mRes;
@@ -306,7 +307,7 @@ public:
ResTIMG* getResTIMG(u16) const;
JUTPalette* getPalette(u16) const;
virtual ~J2DAnmTexPattern() { delete[] mTIMGPtrArray; }
virtual ~J2DAnmTexPattern() { JKR_DELETE_ARRAY(mTIMGPtrArray); }
virtual void searchUpdateMaterialID(J2DScreen*);
u16 getUpdateMaterialNum() const { return mUpdateMaterialNum; }
u16 getUpdateMaterialID(u16 i) const {