Worked a bit on the heap

This commit is contained in:
Victor Olin 2023-02-10 13:45:53 +01:00
parent b6ca1781ea
commit afd5463310

View file

@ -4,6 +4,8 @@
#include <memory> #include <memory>
#include <stdlib.h> #include <stdlib.h>
#include "include/heap.hpp"
namespace GC { namespace GC {
class Allocator { class Allocator {
@ -12,11 +14,18 @@ public:
alloc_size = size; alloc_size = size;
} }
~Allocator() { }
size_t getSize() { size_t getSize() {
return alloc_size; return alloc_size;
} }
void *alloc(); void *alloc() {
auto heap = Heap::the();
assert(heap.getHeapSize() + alloc_size <= HEAP_SIZE);
}
private: private:
size_t alloc_size; size_t alloc_size;