summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/pso/THeap.h28
-rw-r--r--include/pso/forward.h1
2 files changed, 29 insertions, 0 deletions
diff --git a/include/pso/THeap.h b/include/pso/THeap.h
new file mode 100644
index 0000000..fa8df22
--- /dev/null
+++ b/include/pso/THeap.h
@@ -0,0 +1,28 @@
+#ifndef TMAINTASK_H
+#define TMAINTASK_H
+
+#include "pso/forward.h"
+#include "pso/macros.h"
+#include <global_types.h>
+#include <stdlib.h>
+
+void *heap_xfree(void *ptr);
+void *heap_xmalloc(size_t size);
+
+class THeap {
+public:
+ u8 *heap;
+ size_t alloc_size;
+ s32 align;
+ size_t heap_size;
+ s32 mbr_0x10;
+public:
+ THeap(size_t size, int align);
+ ~THeap();
+ void *operator new(size_t size) { return heap_xmalloc(size); };
+ void operator delete(void *ptr) { heap_xfree(ptr); };
+ void *heap_alloc(size_t size);
+ void *heap_zalloc(size_t size);
+ void heap_free(void *ptr);
+};
+#endif
diff --git a/include/pso/forward.h b/include/pso/forward.h
index ae055af..6c97f81 100644
--- a/include/pso/forward.h
+++ b/include/pso/forward.h
@@ -1,6 +1,7 @@
#ifndef FORWARD_H
#define FORWARD_H
+class THeap;
class TObject;
class TMainTask;