blob: 13593694279434fe6c68fc31fdba65239b570301 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#ifndef THEAP_H
#define THEAP_H
#include "pso/forward.h"
#include "pso/macros.h"
#include <global_types.h>
#include <stdlib.h>
extern THeap *obj_heap;
extern THeap *alt_heap;
class THeap {
public:
struct heap_node {
heap_node *next;
size_t remaining_size;
};
heap_node *heap_nodes;
size_t mbr_0x04;
size_t align;
size_t mbr_0x0C;
size_t mbr_0x10;
public:
THeap(size_t size, int align);
~THeap();
void *operator new(size_t size);
void operator delete(void *ptr);
void *heap_alloc(size_t size);
void *heap_zalloc(size_t size);
void heap_free(void *ptr);
};
#endif
|