lref.h 577 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. ** $Id: lref.h,v 1.2 1999/11/10 15:37:50 roberto Exp roberto $
  3. ** REF mechanism
  4. ** See Copyright Notice in lua.h
  5. */
  6. #ifndef lref_h
  7. #define lref_h
  8. #include "lobject.h"
  9. #define NONEXT -1 /* to end the free list */
  10. #define HOLD -2
  11. #define COLLECTED -3
  12. #define LOCK -4
  13. struct ref {
  14. TObject o;
  15. int st; /* can be LOCK, HOLD, COLLECTED, or next (for free list) */
  16. };
  17. int luaR_ref (lua_State *L, const TObject *o, int lock);
  18. const TObject *luaR_getref (lua_State *L, int ref);
  19. void luaR_invalidaterefs (lua_State *L);
  20. #endif