aboutsummaryrefslogtreecommitdiff
path: root/opcode.c
diff options
context:
space:
mode:
authorWaldemar Celes <celes@tecgraf.puc-rio.br>1994-04-20 19:07:57 -0300
committerWaldemar Celes <celes@tecgraf.puc-rio.br>1994-04-20 19:07:57 -0300
commit44521b21e542831a95de0c63271cd38d1cd4d394 (patch)
tree0fd861510cd5c0a1880410442c642c2388a02e57 /opcode.c
parentf8fb7b39478c3468192c69fcb2154f9022dbab64 (diff)
downloadlua-44521b21e542831a95de0c63271cd38d1cd4d394.tar.gz
lua-44521b21e542831a95de0c63271cd38d1cd4d394.tar.bz2
lua-44521b21e542831a95de0c63271cd38d1cd4d394.zip
Implementacao da nova estrategia para armazenar os arrays
em lista encadeada.
Diffstat (limited to 'opcode.c')
-rw-r--r--opcode.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/opcode.c b/opcode.c
index aaf38b51..261baa5d 100644
--- a/opcode.c
+++ b/opcode.c
@@ -3,7 +3,7 @@
3** TecCGraf - PUC-Rio 3** TecCGraf - PUC-Rio
4*/ 4*/
5 5
6char *rcs_opcode="$Id: opcode.c,v 1.3 1994/03/28 15:14:02 celes Exp celes $"; 6char *rcs_opcode="$Id: opcode.c,v 1.4 1994/04/13 21:37:20 celes Exp celes $";
7 7
8#include <stdio.h> 8#include <stdio.h>
9#include <stdlib.h> 9#include <stdlib.h>
@@ -319,7 +319,7 @@ int lua_execute (Byte *pc)
319 if (tonumber(top-1)) return 1; 319 if (tonumber(top-1)) return 1;
320 if (nvalue(top-1) <= 0) nvalue(top-1) = 101; 320 if (nvalue(top-1) <= 0) nvalue(top-1) = 101;
321 } 321 }
322 avalue(top-1) = lua_createarray(lua_hashcreate(nvalue(top-1))); 322 avalue(top-1) = lua_createarray(nvalue(top-1));
323 if (avalue(top-1) == NULL) 323 if (avalue(top-1) == NULL)
324 return 1; 324 return 1;
325 tag(top-1) = T_ARRAY; 325 tag(top-1) = T_ARRAY;
@@ -603,13 +603,13 @@ int lua_execute (Byte *pc)
603 603
604 604
605/* 605/*
606** Mark all strings and arrays used by any object stored at stack. 606** Traverse all objects on stack
607*/ 607*/
608void lua_markstack (void) 608void lua_travstack (void (*fn)(Object *))
609{ 609{
610 Object *o; 610 Object *o;
611 for (o = top-1; o >= stack; o--) 611 for (o = top-1; o >= stack; o--)
612 lua_markobject (o); 612 fn (o);
613} 613}
614 614
615/* 615/*