aboutsummaryrefslogtreecommitdiff
path: root/gc.h
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2013-08-15 20:25:37 +0800
committerTeddy <ted.sybil@gmail.com>2013-08-15 20:25:37 +0800
commit8ac9aa9f90b608421098efb563a065f8787dbd6f (patch)
tree3bf018777a3c49ff7138294fdff5d6bd3325c69d /gc.h
parent9b1d0e016822509e5d3ea7bdc6341b4533b42080 (diff)
remove unnecessary std::set in gcgc_imp
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) \