diff -r 581a9c793062 -r 864e4b02a4c1 jitcraft/Zone.cpp --- a/jitcraft/Zone.cpp Sun Jul 08 01:54:08 2012 -0700 +++ b/jitcraft/Zone.cpp Sun Jul 08 11:33:12 2012 -0700 @@ -19,6 +19,7 @@ #include "Zone.h" #include "StringPool.h" #include "TypeManager.h" +#include "GlobalRoots.h" #include "AllocatorPolicies.h" using namespace ke; @@ -28,14 +29,17 @@ Zone::Zone() : heap_(this), types_(NULL), + symbols_(NULL), + globalRoots_(NULL), lastLocalRoot_(NULL) { } Zone::~Zone() { + delete types_; delete symbols_; - delete types_; + delete globalRoots_; } bool @@ -50,6 +54,10 @@ if (!symbols_ || !symbols_->initialize()) return false; + globalRoots_ = new GlobalRoots(this); + if (!globalRoots_ || !globalRoots_->initialize()) + return false; + maps_[MapKind_Meta] = heap_.metaMap(); if ((maps_[MapKind_Type] = allocateMap(MapKind_Type, sizeof(Map))) == NULL) return false; @@ -103,6 +111,7 @@ local = local->prev(); } + globalRoots_->accept(visitor); rootScopes_.accept(visitor); stack_.accept(visitor);