churf/src/GC/tests/h_test.cpp
Victor Olin 42c22bc1eb Continued debugging
Co-authored-by: ValterMiari <ValterMiari@users.noreply.github.com>
2023-02-24 13:39:55 +01:00

24 lines
No EOL
560 B
C++

#include "heap.hpp"
GC::Heap *gc = GC::Heap::the2();
void init() {
std::vector<int> live_int_vec{1, 2, 3, 4, 5};
std::vector<int> dead_int_vec(1000000, 1);
int *arr = static_cast<int *>(gc->alloc(sizeof(int) * 300));
int *a_ptr;
int a = 10;
a_ptr = &a;
auto temp1 = gc->alloc(sizeof(a_ptr));
auto temp2 = gc->alloc(sizeof(live_int_vec));
auto temp3 = gc->alloc(sizeof(dead_int_vec));
a_ptr = nullptr;
}
int main() {
init();
gc->collect(MARK | SWEEP);
gc->print_contents();
//delete gc;
return 0;
}