Added a product.version file.
2 * Copyright (C) 2004-2012 David Anderson
4 * This file is part of SourcePawn.
6 * SourcePawn is free software: you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License as published by the Free
8 * Software Foundation, either version 3 of the License, or (at your option)
11 * SourcePawn is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along with
16 * SourcePawn. If not, see http://www.gnu.org/licenses/.
18 #include "GlobalRoots.h"
23 GlobalRoots::GlobalRoots(Zone *zone)
28 GlobalRoots::~GlobalRoots()
30 InlineList<HeapRoot>::iterator iter = roots_.begin();
31 while (iter != roots_.end()) {
32 HeapRoot *root = *iter;
33 iter = roots_.erase(iter);
39 GlobalRoots::initialize()
45 GlobalRoots::accept(VirtualObjectVisitor *visitor)
47 for (InlineList<HeapRoot>::iterator iter = roots_.begin(); iter != roots_.end(); iter++)
48 visitor->visit(&iter->obj);
52 GlobalRoots::create(Handle<Object> obj)
54 HeapRoot *root = new HeapRoot();
56 ZONE()->reportOutOfMemory();
68 GlobalRoots::incref(HeapRoot *root)
74 GlobalRoots::decref(HeapRoot *root)
76 assert(root->refcount > 0);
77 if (--root->refcount == 0) {