PRIVATE: fix memory leaks and added more stuff into the main class

This commit is contained in:
neuromancer 2021-02-19 18:01:52 -03:00 committed by Eugene Sandulenko
parent 4d8144f32d
commit 020aa0a867
5 changed files with 38 additions and 54 deletions

View file

@ -60,32 +60,6 @@ Inst *prog = NULL; /* the machine */
Inst *progp = NULL; /* next free spot for code generation */
Inst *pc = NULL; /* program counter during execution */
static struct InstDescr {
const Inst func;
const char *name;
} instDescr[] = {
{ 0, "STOP", },
{ constpush,"constpush" },
{ strpush, "strpush", },
{ varpush, "varpush", },
{ funcpush, "funcpush", },
{ eval, "eval", },
{ ifcode, "ifcode", },
{ add, "add", },
{ negate, "negate", },
{ 0, 0}
};
PtrToName _insts;
void initInsts() {
for (InstDescr *fnc = instDescr; fnc->name; fnc++) {
_insts[(void *)fnc->func] = new Common::String(fnc->name);
}
}
/* initialize setting for code generation */
void SettingMaps::init() {
setting = (Setting *)malloc(sizeof(Setting));