ds@126: /* vim: set ts=4 sw=4 tw=99 et: ds@126: * dvander@61: * Copyright (C) 2004-2012 David Anderson dvander@61: * dvander@61: * This file is part of SourcePawn. dvander@61: * dvander@61: * SourcePawn is free software: you can redistribute it and/or modify it under dvander@61: * the terms of the GNU General Public License as published by the Free dvander@61: * Software Foundation, either version 3 of the License, or (at your option) dvander@61: * any later version. dvander@61: * dvander@61: * SourcePawn is distributed in the hope that it will be useful, but WITHOUT ANY dvander@61: * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS dvander@61: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. dvander@61: * dvander@61: * You should have received a copy of the GNU General Public License along with dvander@61: * SourcePawn. If not, see http://www.gnu.org/licenses/. dvander@61: */ dvander@61: #ifndef _include_ke_global_roots_h_ dvander@61: #define _include_ke_global_roots_h_ dvander@61: danderson@92: #include "Utility.h" dvander@61: #include "Handles.h" dvander@61: #include "InlineList.h" dvander@61: #include "VirtualObjectVisitor.h" dvander@61: dvander@61: namespace ke { dvander@61: dvander@61: class Zone; dvander@61: class Object; dvander@61: dvander@61: class HeapRoot : public InlineListNode dvander@61: { dvander@61: public: dvander@61: Object *obj; dvander@61: }; dvander@61: dvander@61: class GlobalRoots dvander@61: { dvander@61: Zone *zone_; dvander@61: dvander@61: public: dvander@61: GlobalRoots(Zone *zone); dvander@61: ~GlobalRoots(); dvander@61: dvander@61: bool initialize(); dvander@61: dvander@195: HeapRoot *create(); dvander@195: void destroy(HeapRoot *root); dvander@61: dvander@61: void accept(VirtualObjectVisitor *visitor); dvander@61: dvander@61: private: dvander@61: InlineList roots_; dvander@61: }; dvander@61: dvander@61: } dvander@61: dvander@61: #endif // _include_ke_global_roots_h_