diff --git a/src/GC/include/event.hpp b/src/GC/include/event.hpp index cf4a57f..9c03cd6 100644 --- a/src/GC/include/event.hpp +++ b/src/GC/include/event.hpp @@ -44,7 +44,6 @@ namespace GC { TimeStamp getTimeStamp(); Chunk *getChunk(); - void printShort(); - void printFull(); + void print(std::ostream &out); }; } \ No newline at end of file diff --git a/src/GC/include/profiler.hpp b/src/GC/include/profiler.hpp index 2055c18..7e305e4 100644 --- a/src/GC/include/profiler.hpp +++ b/src/GC/include/profiler.hpp @@ -10,11 +10,6 @@ using namespace std; namespace GC { - enum PrintTraceOptions { - Short, - Full - }; - class Profiler { private: Profiler() { } @@ -33,6 +28,6 @@ namespace GC { public: static void record(GCEventType type); static void record(GCEventType type, Chunk *chunk); - static void printTrace(PrintTraceOptions opt); + static void printTrace(); }; } \ No newline at end of file diff --git a/src/GC/lib/event.cpp b/src/GC/lib/event.cpp index e1367db..b4b62c6 100644 --- a/src/GC/lib/event.cpp +++ b/src/GC/lib/event.cpp @@ -6,7 +6,7 @@ #include "event.hpp" #include "heap.hpp" -using namespace std; +// using namespace std; namespace GC { @@ -22,12 +22,7 @@ namespace GC { return m_chunk; } - void GCEvent::printShort() { + void GCEvent::print(std::ostream &out) { assert(false && "TODO: unimplemented"); } - - void GCEvent::printFull() { - assert(false && "TODO: unimplemented"); - ostream s1 = cout; - } } \ No newline at end of file diff --git a/src/GC/lib/profiler.cpp b/src/GC/lib/profiler.cpp index 6138a52..18b3810 100644 --- a/src/GC/lib/profiler.cpp +++ b/src/GC/lib/profiler.cpp @@ -19,16 +19,13 @@ namespace GC { profiler->m_events.push_back(event); } - void Profiler::printTrace(PrintTraceOptions opt) { + void Profiler::printTrace() { auto profiler = Profiler::the(); auto start = profiler->m_events.begin(); auto end = profiler->m_events.end(); while (start != end) { auto event = *start++; - if (opt == Short) - event->printShort(); - else - event->printFull(); + event->print(std::cout); } } } \ No newline at end of file diff --git a/src/GC/todo.md b/src/GC/todo.md index bf3ee51..17f159f 100644 --- a/src/GC/todo.md +++ b/src/GC/todo.md @@ -6,7 +6,9 @@ Goal for next week (24/2): - Write more complex tests ## GC TODO: -- Double check m_heap_size functionality and when a collection is triggered +- Skriva klart profiler +- Kolla linking med Valter/Victor +- Fixa en a-fil/static lib till Samuel - Kolla vektor vs list complexity ## Tests TODO