mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-13 13:56:49 -04:00
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:
@@ -17,7 +17,7 @@ JASBasicInst::JASBasicInst() {
|
||||
}
|
||||
|
||||
JASBasicInst::~JASBasicInst() {
|
||||
delete[] mKeymap;
|
||||
JKR_DELETE_ARRAY(mKeymap);
|
||||
}
|
||||
|
||||
bool JASBasicInst::getParam(int param_0, int param_1, JASInstParam* param_2) const {
|
||||
@@ -48,8 +48,8 @@ bool JASBasicInst::getParam(int param_0, int param_1, JASInstParam* param_2) con
|
||||
}
|
||||
|
||||
void JASBasicInst::setKeyRegionCount(u32 count, JKRHeap* param_1) {
|
||||
delete [] mKeymap;
|
||||
mKeymap = new (param_1, 0) TKeymap[count];
|
||||
JKR_DELETE_ARRAY(mKeymap);
|
||||
mKeymap = JKR_NEW_ARGS (param_1, 0) TKeymap[count];
|
||||
JUT_ASSERT(114, mKeymap != NULL);
|
||||
mKeymapCount = count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user