From 53fb65d39451f9245d8ed555f941829520ee6f24 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 10 Nov 1999 13:37:50 -0200 Subject: better implementation of `lua_ref' (much better...) --- lref.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'lref.h') diff --git a/lref.h b/lref.h index 60e14e85..180daab0 100644 --- a/lref.h +++ b/lref.h @@ -1,5 +1,5 @@ /* -** $Id: $ +** $Id: lref.h,v 1.1 1999/10/04 17:50:24 roberto Exp roberto $ ** REF mechanism ** See Copyright Notice in lua.h */ @@ -9,6 +9,19 @@ #include "lobject.h" + +#define NONEXT -1 /* to end the free list */ +#define HOLD -2 +#define COLLECTED -3 +#define LOCK -4 + + +struct ref { + TObject o; + int st; /* can be LOCK, HOLD, COLLECTED, or next (for free list) */ +}; + + int luaR_ref (const TObject *o, int lock); const TObject *luaR_getref (int ref); void luaR_invalidaterefs (void); -- cgit v1.2.3-55-g6feb