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 f59295c127
commit 0ee3b2b197
634 changed files with 3451 additions and 3350 deletions
@@ -1,8 +1,9 @@
#include "JSystem/JSystem.h" // IWYU pragma: keep
#include "JSystem/J3DGraphAnimator/J3DMaterialAttach.h"
#include "JSystem/J3DGraphAnimator/J3DMaterialAnm.h"
#include "JSystem/J3DGraphAnimator/J3DMaterialAttach.h"
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JUtility/JUTAssert.h"
void J3DMaterialTable::clear() {
@@ -153,7 +154,7 @@ int J3DMaterialTable::createTexMtxForAnimator(J3DAnmTextureSRTKey* pTexSRTKey) {
rv = 1;
} else {
if (texMtx != 0xff && material->getTexMtx(texMtx) == NULL) {
J3DTexMtx* mtx = new J3DTexMtx();
J3DTexMtx* mtx = JKR_NEW J3DTexMtx();
rv = 4;
material->setTexMtx(texMtx, mtx);
JUT_WARN(420, "matNo<%d> : texMtx%d nothing !\n", matNo, texMtx);