Yoinked over the garbage collector.

This commit is contained in:
Samuel Hammersberg 2023-03-28 14:15:22 +02:00
parent 2aff7a7743
commit 85f31b129b
33 changed files with 2417 additions and 0 deletions

30
src/GC/tests/linker.cpp Normal file
View file

@ -0,0 +1,30 @@
#include <stdio.h>
#include "heap.hpp"
struct Obj {
int a;
int b;
int c;
};
int main() {
auto heap = GC::Heap::debug_the();
std::cout << "heap:\t" << heap << std::endl;
auto obj = static_cast<Obj *>(GC::Heap::alloc(sizeof(Obj)));
std::cout << "obj: \t" << obj << std::endl;
obj->a = 3;
obj->b = 4;
obj->c = 5;
std::cout << obj->a << ", " << obj->b << ", " << obj->c << std::endl;
heap->print_contents();
//delete heap;
return 0;
}