From cf8972948066c859a9024ffe81afa95156972c53 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Fri, 10 Feb 2023 13:27:50 -0400 Subject: TObject: Implement, and match `alloc()`, and `free()` --- include/pso/TObject.h | 3 ++- src/pso/TObject.cpp | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/pso/TObject.h b/include/pso/TObject.h index c851480..3a9f097 100644 --- a/include/pso/TObject.h +++ b/include/pso/TObject.h @@ -3,6 +3,7 @@ #include "pso/forward.h" #include "pso/macros.h" +#include #include #define o(name) extern const char *name##_name; @@ -66,7 +67,7 @@ public: TObject(TObject *parent = NULL); virtual ~TObject(); - void *operator new (unsigned long size) { return alloc(size); }; + void *operator new (size_t size) { return alloc(size); }; void operator delete(void *ptr) { free(ptr); }; void delete_children(); diff --git a/src/pso/TObject.cpp b/src/pso/TObject.cpp index 1d87c4b..3fa37d2 100644 --- a/src/pso/TObject.cpp +++ b/src/pso/TObject.cpp @@ -1,3 +1,4 @@ +#include "pso/THeap.h" #include "pso/TMainTask.h" #include "pso/TObject.h" #define MATCHING @@ -32,11 +33,11 @@ bool TObject::toggle_flag_9_if_flag_10_is_clear() { } void TObject::free(void *ptr) { - + obj_heap->heap_free(ptr); } -void *TObject::alloc(unsigned long size) { - return NULL; +void *TObject::alloc(size_t size) { + return obj_heap->heap_alloc(size); } -- cgit v1.2.3-13-gbd6f