diff options
Diffstat (limited to '')
| -rw-r--r-- | lref.h | 15 |
1 files changed, 14 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: $ | 2 | ** $Id: lref.h,v 1.1 1999/10/04 17:50:24 roberto Exp roberto $ |
| 3 | ** REF mechanism | 3 | ** REF mechanism |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -9,6 +9,19 @@ | |||
| 9 | 9 | ||
| 10 | #include "lobject.h" | 10 | #include "lobject.h" |
| 11 | 11 | ||
| 12 | |||
| 13 | #define NONEXT -1 /* to end the free list */ | ||
| 14 | #define HOLD -2 | ||
| 15 | #define COLLECTED -3 | ||
| 16 | #define LOCK -4 | ||
| 17 | |||
| 18 | |||
| 19 | struct ref { | ||
| 20 | TObject o; | ||
| 21 | int st; /* can be LOCK, HOLD, COLLECTED, or next (for free list) */ | ||
| 22 | }; | ||
| 23 | |||
| 24 | |||
| 12 | int luaR_ref (const TObject *o, int lock); | 25 | int luaR_ref (const TObject *o, int lock); |
| 13 | const TObject *luaR_getref (int ref); | 26 | const TObject *luaR_getref (int ref); |
| 14 | void luaR_invalidaterefs (void); | 27 | void luaR_invalidaterefs (void); |
