aboutsummaryrefslogtreecommitdiff
path: root/gc.h
diff options
context:
space:
mode:
Diffstat (limited to 'gc.h')
-rw-r--r--gc.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/gc.h b/gc.h
index 9f1aca6..ad8ac6b 100644
--- a/gc.h
+++ b/gc.h
@@ -12,8 +12,12 @@ class GarbageCollector;
#define GC_CYC_TRIGGER(ptr) \
do { \
- if ((ptr) && (ptr)->is_container() && !visited.count(ptr)) \
- visited.insert(*tail++ = (ptr)); \
+ if ((ptr) && (ptr)->is_container() && \
+ !(static_cast<Container*>(ptr)->keep)) \
+ { \
+ static_cast<Container*>(ptr)->keep = true; \
+ *tail++ = (ptr); \
+ } \
} while (0)
#define GC_CYC_DEC(ptr) \