lua

A copy of the Lua development repository
Log | Files | Refs | README

commit b44e35b773bcaa9891d80a117392911ab5f656e5
parent 21843f022aac2c168d73c4d7ca3692739296f699
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Wed, 11 Aug 1999 14:00:37 -0300

new constants LUA_NOREF and LUA_REFNIL.

Diffstat:
Mlgc.c | 6+++---
Mlua.h | 5++++-
2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/lgc.c b/lgc.c @@ -1,5 +1,5 @@ /* -** $Id: lgc.c,v 1.22 1999/02/26 15:48:55 roberto Exp roberto $ +** $Id: lgc.c,v 1.23 1999/03/04 21:17:26 roberto Exp roberto $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -32,7 +32,7 @@ static int markobject (TObject *o); int luaC_ref (TObject *o, int lock) { int ref; if (ttype(o) == LUA_T_NIL) - ref = -1; /* special ref for nil */ + ref = LUA_REFNIL; else { for (ref=0; ref<L->refSize; ref++) if (L->refArray[ref].status == FREE) @@ -57,7 +57,7 @@ void lua_unref (int ref) TObject* luaC_getref (int ref) { - if (ref == -1) + if (ref == LUA_REFNIL) return &luaO_nilobject; if (ref >= 0 && ref < L->refSize && (L->refArray[ref].status == LOCK || L->refArray[ref].status == HOLD)) diff --git a/lua.h b/lua.h @@ -1,5 +1,5 @@ /* -** $Id: lua.h,v 1.31 1999/04/15 12:33:19 roberto Exp roberto $ +** $Id: lua.h,v 1.32 1999/05/11 20:29:19 roberto Exp roberto $ ** Lua - An Extensible Extension Language ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil ** e-mail: lua@tecgraf.puc-rio.br @@ -18,6 +18,9 @@ #define LUA_NOOBJECT 0 +#define LUA_NOREF (-2) +#define LUA_REFNIL (-1) + #define LUA_ANYTAG (-1) typedef struct lua_State lua_State;