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
@@ -16,7 +16,7 @@ struct TCreateObject {
template<class AdaptorT>
static typename AdaptorT::ObjectType* createFromAdaptor(JStudio::stb::data::TParse_TBlock_object const& param_1, AdaptorT* param_2) {
typename AdaptorT::ObjectType* rv = new typename AdaptorT::ObjectType(param_1, param_2);
typename AdaptorT::ObjectType* rv = JKR_NEW typename AdaptorT::ObjectType(param_1, param_2);
if (rv == NULL) {
return NULL;
}
@@ -133,7 +133,7 @@ public:
template<class T>
T* createFromAdaptor(const stb::data::TParse_TBlock_object& param_0, T* param_1) {
T* n = new T(param_0, param_1);
T* n = JKR_NEW T(param_0, param_1);
if (n == NULL) {
return NULL;
@@ -321,7 +321,7 @@ template <class AdaptorT, class ObjectT>
JStudio::TObject* createObject_JSG_(const JStudio::stb::data::TParse_TBlock_object& param_1,
JStage::TObject* param_2, const JStage::TSystem* param_3) {
ObjectT* objt = (ObjectT*)param_2;
AdaptorT* pAdaptor = new AdaptorT(param_3, objt);
AdaptorT* pAdaptor = JKR_NEW AdaptorT(param_3, objt);
if (pAdaptor == NULL) {
return NULL;
}