Some configurations
This commit is contained in:
parent
1690804821
commit
30a3da3156
3 changed files with 19 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -7,5 +7,6 @@ src/Grammar
|
||||||
language
|
language
|
||||||
llvm.ll
|
llvm.ll
|
||||||
/language
|
/language
|
||||||
|
.vscode/
|
||||||
|
|
||||||
src/GC/tests/*.out
|
src/GC/tests/*.out
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#include "include/chunk.hpp"
|
#include "chunk.hpp"
|
||||||
|
|
||||||
#define HEAP_SIZE 65536
|
#define HEAP_SIZE 65536
|
||||||
|
|
||||||
|
|
@ -29,6 +29,7 @@ namespace GC {
|
||||||
}
|
}
|
||||||
|
|
||||||
void *alloc(size_t size);
|
void *alloc(size_t size);
|
||||||
|
void print_contents();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue