Some configurations

This commit is contained in:
valtermiari 2023-02-15 10:42:27 +01:00 committed by Victor Olin
parent 1690804821
commit 30a3da3156
3 changed files with 19 additions and 1 deletions

1
.gitignore vendored
View file

@ -7,5 +7,6 @@ src/Grammar
language
llvm.ll
/language
.vscode/
src/GC/tests/*.out

View file

@ -118,4 +118,20 @@ namespace GC {
}
}
}
// For testing purposes
void print_line(bool marked, void *start, size_t size) {
std::cout << "Marked: " << marked << "\nStart adr: " << start << "\nSize" << size << std::endl;
}
void Heap::print_contents() {
std::cout << "ALLOCATED CHUNKS" << std::endl;
for (auto chunk : m_allocated_chunks) {
print_line(chunk->marked, chunk->start, chunk->size);
}
std::cout << "FREED CHUNKS" << std::endl;
for (auto fchunk : m_freed_chunks) {
print_line(fchunk->marked, fchunk->start, fchunk->size);
}
}
}

View file

@ -7,7 +7,7 @@
#include <vector>
using namespace std;
#include "include/chunk.hpp"
#include "chunk.hpp"
#define HEAP_SIZE 65536
@ -29,6 +29,7 @@ namespace GC {
}
void *alloc(size_t size);
void print_contents();
private: