better implementation of `lua_ref' (much better...)

This commit is contained in:
Roberto Ierusalimschy
1999-11-10 13:37:50 -02:00
parent a7fa7bafc8
commit 53fb65d394
2 changed files with 46 additions and 16 deletions

15
lref.h
View File

@@ -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);