Remove calls to ZONE().
1 /* vim: set ts=4 sw=4 tw=99 et:
3 * Copyright (C) 2012 David Anderson
5 * This file is part of JITCraft.
7 * JITCraft is free software: you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License as published by the Free
9 * Software Foundation, either version 3 of the License, or (at your option)
12 * Foobar is distributed in the hope that it will be useful, but WITHOUT ANY
13 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with
17 * JITCraft. If not, see http://www.gnu.org/licenses/.
19 #ifndef _include_jc_root_scopes_h_
20 #define _include_jc_root_scopes_h_
28 // A RootScopeManager is essentially a specialized PoolAllocator that can
29 // only allocate Object ** entries. It is used to allow huge, temporary
30 // heap data structures like ASTs to hold safe references to objects. When
31 // the data structures is no longer needed, all of the roots are removed
33 class RootScopeManager
35 static const size_t kObjectsPerBlock = 4096;
38 Object *objects[kObjectsPerBlock];
45 end(objects + kObjectsPerBlock),
53 void unwindSlow(Object **position);
59 Object **position() const {
63 void unwind(Object **position) {
64 if (position >= blocks_->cur && position <= blocks_->end) {
65 blocks_->cur = position;
71 Object **make(Object *obj) {
73 if (blocks_->cur + 1 > blocks_->end) {
77 Object **ptr = blocks_->cur;
100 // These are implemented in Zone.h.
101 inline RootScope(Zone *zone);
107 #endif // _include_jc_root_scope_h_