Changeset bd06384 for src/Common/GC.cc
- Timestamp:
- Mar 22, 2018, 4:49:53 PM (6 years ago)
- Branches:
- new-env, with_gc
- Children:
- dbc2c2c
- Parents:
- 7e4b44db
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/GC.cc
r7e4b44db rbd06384 16 16 #include "GC.h" 17 17 18 #include "Common/PassVisitor.h" 19 20 #include "SynTree/GcTracer.h" 21 18 22 #include <algorithm> 19 23 #include <cassert> … … 24 28 } 25 29 26 GC::GC() : mark(false), old(), young(), using_young(false) {30 GC::GC() : mark(false), using_young(false), old(), young(), static_roots() { 27 31 old.reserve(70000); 28 32 } … … 55 59 } 56 60 61 void GC::register_static_root(BaseSyntaxNode* root) { 62 static_roots.push_back(root); 63 } 64 57 65 void GC::new_generation() { 58 66 using_young = true; 67 } 68 69 void GC::trace_static_roots() { 70 PassVisitor<GcTracer> tracer{ *this }; 71 for ( BaseSyntaxNode* root : static_roots ) { 72 root->accept( tracer ); 73 } 59 74 } 60 75
Note: See TracChangeset
for help on using the changeset viewer.