aboutsummaryrefslogtreecommitdiff
path: root/gc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gc.cpp')
-rw-r--r--gc.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/gc.cpp b/gc.cpp
index 85486b6..775463f 100644
--- a/gc.cpp
+++ b/gc.cpp
@@ -14,6 +14,7 @@ static Container *cyc_list[GC_QUEUE_SIZE];
GarbageCollector::GarbageCollector() {
mapping.clear();
pending_list = NULL;
+ resolve_threshold = GC_CYC_THRESHOLD;
}
GarbageCollector::PendingEntry::PendingEntry(
@@ -113,7 +114,7 @@ EvalObj *GarbageCollector::attach(EvalObj *ptr) {
}
void GarbageCollector::cycle_resolve() {
- if (mapping.size() < GC_CYC_THRESHOLD)
+ if (mapping.size() < resolve_threshold)
return;
EvalObjSet visited;
Container **clptr = cyc_list;
@@ -152,3 +153,11 @@ void GarbageCollector::cycle_resolve() {
#endif
force();
}
+
+size_t GarbageCollector::get_remaining() {
+ return mapping.size();
+}
+
+void GarbageCollector::set_resolve_threshold(size_t new_thres) {
+ resolve_threshold = new_thres;
+}