summaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-12-26 16:46:09 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-12-26 16:46:09 -0200
commit8c49e198654567f770a7d5081b886a7c35201d81 (patch)
tree8c1de3e885ef138574e51a8868f175feeaab71e2 /lgc.c
parent6af005ec20323defd2a5ead01e2d389462884d04 (diff)
downloadlua-8c49e198654567f770a7d5081b886a7c35201d81.tar.gz
lua-8c49e198654567f770a7d5081b886a7c35201d81.tar.bz2
lua-8c49e198654567f770a7d5081b886a7c35201d81.zip
explicit control of size for growing vectors
Diffstat (limited to 'lgc.c')
-rw-r--r--lgc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lgc.c b/lgc.c
index 6949b061..7b35ee03 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 1.72 2000/10/26 12:47:05 roberto Exp roberto $ 2** $Id: lgc.c,v 1.73 2000/11/24 17:39:56 roberto Exp roberto $
3** Garbage Collector 3** Garbage Collector
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -56,7 +56,7 @@ static void markstack (lua_State *L, GCState *st) {
56 56
57static void marklock (lua_State *L, GCState *st) { 57static void marklock (lua_State *L, GCState *st) {
58 int i; 58 int i;
59 for (i=0; i<L->refSize; i++) { 59 for (i=0; i<L->nref; i++) {
60 if (L->refArray[i].st == LOCK) 60 if (L->refArray[i].st == LOCK)
61 markobject(st, &L->refArray[i].o); 61 markobject(st, &L->refArray[i].o);
62 } 62 }
@@ -77,7 +77,7 @@ static void marktagmethods (lua_State *L, GCState *st) {
77 int e; 77 int e;
78 for (e=0; e<TM_N; e++) { 78 for (e=0; e<TM_N; e++) {
79 int t; 79 int t;
80 for (t=0; t<=L->last_tag; t++) { 80 for (t=0; t<L->ntag; t++) {
81 Closure *cl = luaT_gettm(L, t, e); 81 Closure *cl = luaT_gettm(L, t, e);
82 if (cl) markclosure(st, cl); 82 if (cl) markclosure(st, cl);
83 } 83 }
@@ -162,7 +162,7 @@ static int hasmark (const TObject *o) {
162#define VALIDLINK(L, st,n) (NONEXT <= (st) && (st) < (n)) 162#define VALIDLINK(L, st,n) (NONEXT <= (st) && (st) < (n))
163 163
164static void invalidaterefs (lua_State *L) { 164static void invalidaterefs (lua_State *L) {
165 int n = L->refSize; 165 int n = L->nref;
166 int i; 166 int i;
167 for (i=0; i<n; i++) { 167 for (i=0; i<n; i++) {
168 struct Ref *r = &L->refArray[i]; 168 struct Ref *r = &L->refArray[i];
@@ -314,7 +314,7 @@ static void callgcTMudata (lua_State *L) {
314 TObject o; 314 TObject o;
315 ttype(&o) = LUA_TUSERDATA; 315 ttype(&o) = LUA_TUSERDATA;
316 L->GCthreshold = 2*L->nblocks; /* avoid GC during tag methods */ 316 L->GCthreshold = 2*L->nblocks; /* avoid GC during tag methods */
317 for (tag=L->last_tag; tag>=0; tag--) { /* for each tag (in reverse order) */ 317 for (tag=L->ntag-1; tag>=0; tag--) { /* for each tag (in reverse order) */
318 TString *udata; 318 TString *udata;
319 while ((udata = L->TMtable[tag].collected) != NULL) { 319 while ((udata = L->TMtable[tag].collected) != NULL) {
320 L->TMtable[tag].collected = udata->nexthash; /* remove it from list */ 320 L->TMtable[tag].collected = udata->nexthash; /* remove it from list */