Skip to content

Commit

Permalink
prints in arena
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarhiggott committed Jul 24, 2024
1 parent dabb42d commit 47f084b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pymatching/sparse_blossom/arena.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ struct Arena {
}

~Arena() {
std::cout << "Arena0" << std::endl;
std::vector<T *> to_free = std::move(allocated);
std::vector<T *> not_in_use = std::move(available);

std::cout << "Arena1" << std::endl;
// Destruct the objects that were still in use.
std::sort(to_free.begin(), to_free.end());
std::sort(not_in_use.begin(), not_in_use.end());
Expand All @@ -75,11 +76,12 @@ struct Arena {
kf++;
}
}

std::cout << "Arena2" << std::endl;
// Free all allocated memory.
for (T *v : to_free) {
free(v);
}
std::cout << "Arena3" << std::endl;
}
};
} // namespace pm
Expand Down

0 comments on commit 47f084b

Please sign in to comment.