Worked a bit on the heap
This commit is contained in:
parent
17d41a408d
commit
e52c38f5f7
1 changed files with 10 additions and 1 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue