dvander@0: /* dvander@0: * Copyright (C) 2012 David Anderson dvander@0: * dvander@0: * This file is part of JITCraft. dvander@0: * dvander@0: * JITCraft is free software: you can redistribute it and/or modify it under dvander@0: * the terms of the GNU General Public License as published by the Free dvander@0: * Software Foundation, either version 3 of the License, or (at your option) dvander@0: * any later version. dvander@0: * dvander@0: * Foobar is distributed in the hope that it will be useful, but WITHOUT ANY dvander@0: * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS dvander@0: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. dvander@0: * dvander@0: * You should have received a copy of the GNU General Public License along with dvander@0: * JITCraft. If not, see http://www.gnu.org/licenses/. dvander@0: */ dvander@0: #include "Modules.h" dvander@14: #include "Zone.h" dvander@14: #include "Heap.h" dvander@14: #include "Heap-inl.h" dvander@0: dvander@59: using namespace ke; dvander@0: dvander@14: Module * dvander@195: Module::New(Zone *zone) dvander@0: { dvander@36: Local module(zone, Module::cast(zone->allocate(MapKind_Module, sizeof(Module), Heap::Tenure_Old))); dvander@14: if (!module) dvander@14: return NULL; dvander@14: dvander@70: module->file_ = NULL; dvander@195: module->globals_ = NULL; dvander@68: module->nativeIdentity_ = NULL; dvander@195: module->globals_ = NULL; dvander@14: return module; dvander@0: }