Testing vector indexing

This commit is contained in:
Victor Olin 2023-03-23 13:32:24 +01:00
parent fb4cd8eb9b
commit e745593d94
2 changed files with 14 additions and 11 deletions

View file

@ -67,9 +67,9 @@ void test_some_types() {
int main() {
GC::Heap::init();
GC::Heap *gc = GC::Heap::debug_the();
gc->set_profiler(true);
gc->check_init();
GC::Heap &gc = GC::Heap::the();
gc.set_profiler(true);
gc.check_init();
auto stack_start = reinterpret_cast<uintptr_t *>(__builtin_frame_address(0));
std::cout << "Stack start from main:\t" << stack_start << std::endl;
@ -86,7 +86,7 @@ int main() {
longs++;
} */
Node *root = static_cast<Node *>(gc->alloc(sizeof(Node)));
Node *root = static_cast<Node *>(gc.alloc(sizeof(Node)));
root = test_chain(3, false);
Node *root_child = root->child;
std::cout << "Adress of root:\t" << &root << std::endl;
@ -95,9 +95,9 @@ int main() {
std::cout << "Root child, child:\t" << root_child->child << std::endl;
gc->collect(GC::COLLECT_ALL);
gc->print_contents();
gc->dispose();
gc.collect(GC::COLLECT_ALL);
gc.print_contents();
gc.dispose();
return 0;
}