Implementacao da nova estrategia para armazenar os arrays

em lista encadeada.
This commit is contained in:
Waldemar Celes
1994-04-20 19:07:57 -03:00
parent f8fb7b3947
commit 44521b21e5
6 changed files with 175 additions and 122 deletions

View File

@@ -3,7 +3,7 @@
** TecCGraf - PUC-Rio
*/
char *rcs_opcode="$Id: opcode.c,v 1.3 1994/03/28 15:14:02 celes Exp celes $";
char *rcs_opcode="$Id: opcode.c,v 1.4 1994/04/13 21:37:20 celes Exp celes $";
#include <stdio.h>
#include <stdlib.h>
@@ -319,7 +319,7 @@ int lua_execute (Byte *pc)
if (tonumber(top-1)) return 1;
if (nvalue(top-1) <= 0) nvalue(top-1) = 101;
}
avalue(top-1) = lua_createarray(lua_hashcreate(nvalue(top-1)));
avalue(top-1) = lua_createarray(nvalue(top-1));
if (avalue(top-1) == NULL)
return 1;
tag(top-1) = T_ARRAY;
@@ -603,13 +603,13 @@ int lua_execute (Byte *pc)
/*
** Mark all strings and arrays used by any object stored at stack.
** Traverse all objects on stack
*/
void lua_markstack (void)
void lua_travstack (void (*fn)(Object *))
{
Object *o;
for (o = top-1; o >= stack; o--)
lua_markobject (o);
fn (o);
}
/*