00001 /* 00002 * vm/program.cc 00003 * 00004 * VM program storage. 00005 * 00006 * Copyright (c) 2004 by Wolfgang Wieser ] wwieser (a) gmx <*> de [ 00007 * 00008 * This file may be distributed and/or modified under the terms of the 00009 * GNU General Public License version 2 as published by the Free Software 00010 * Foundation. (See COPYING.GPL for details.) 00011 * 00012 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00013 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00014 * 00015 */ 00016 00017 #include <vm/input/nspcinfo.h> 00018 #include "program.h" 00019 #include <lib/message/message.h> /* FIXME: not needed */ 00020 00021 00022 namespace VM 00023 { 00024 00025 ProgramStorage::Function::Function(SymRef _symref,const SCLocation &_loc, 00026 PrgAdr prealloc_size) : 00027 LinkedListBase<Function>(), 00028 InstructionStorage(prealloc_size), 00029 symref(_symref), 00030 loc(_loc) 00031 { 00032 } 00033 00034 ProgramStorage::Function::~Function() 00035 { 00036 } 00037 00038 //------------------------------------------------------------------------------ 00039 00040 void ProgramStorage::AddFunction(Function *f) 00041 { 00042 flist.append(f); 00043 } 00044 00045 00046 ProgramStorage::ProgramStorage() : 00047 flist() 00048 { 00049 } 00050 00051 ProgramStorage::~ProgramStorage() 00052 { 00053 // Tidy up functions. 00054 while(!flist.IsEmpty()) 00055 { delete flist.PopFirst(); } 00056 } 00057 00058 } // end of namespace VM