Minor refactoring and note in source code

This commit is contained in:
Stephen Seo 2024-06-04 12:17:43 +09:00
parent 2249bed677
commit 67a8e2452f

View file

@ -71,12 +71,12 @@ namespace SC_AM_Internal {
} }
void Stats::print_status() const { void Stats::print_status() const {
// This function intentionally does not free its list of malloced memory as
// it is expected for the OS to reclaim memory from stopped processes and
// this function only runs at the end of program execution.
std::clog << "List of unfreed memory:\n"; std::clog << "List of unfreed memory:\n";
auto *node = malloced_list; auto *node = malloced_list;
[[maybe_unused]]
decltype(node) parent_node;
while (node->next != nullptr) { while (node->next != nullptr) {
parent_node = node;
node = node->next; node = node->next;
std::clog << " " << node->data->address << ": size " << node->data->size << '\n'; std::clog << " " << node->data->address << ": size " << node->data->size << '\n';