diff options
Diffstat (limited to 'lgc.c')
-rw-r--r-- | lgc.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.c,v 1.22 1999/02/26 15:48:55 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 1.23 1999/03/04 21:17:26 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 | */ |
@@ -32,7 +32,7 @@ static int markobject (TObject *o); | |||
32 | int luaC_ref (TObject *o, int lock) { | 32 | int luaC_ref (TObject *o, int lock) { |
33 | int ref; | 33 | int ref; |
34 | if (ttype(o) == LUA_T_NIL) | 34 | if (ttype(o) == LUA_T_NIL) |
35 | ref = -1; /* special ref for nil */ | 35 | ref = LUA_REFNIL; |
36 | else { | 36 | else { |
37 | for (ref=0; ref<L->refSize; ref++) | 37 | for (ref=0; ref<L->refSize; ref++) |
38 | if (L->refArray[ref].status == FREE) | 38 | if (L->refArray[ref].status == FREE) |
@@ -57,7 +57,7 @@ void lua_unref (int ref) | |||
57 | 57 | ||
58 | TObject* luaC_getref (int ref) | 58 | TObject* luaC_getref (int ref) |
59 | { | 59 | { |
60 | if (ref == -1) | 60 | if (ref == LUA_REFNIL) |
61 | return &luaO_nilobject; | 61 | return &luaO_nilobject; |
62 | if (ref >= 0 && ref < L->refSize && | 62 | if (ref >= 0 && ref < L->refSize && |
63 | (L->refArray[ref].status == LOCK || L->refArray[ref].status == HOLD)) | 63 | (L->refArray[ref].status == LOCK || L->refArray[ref].status == HOLD)) |