aboutsummaryrefslogtreecommitdiff
path: root/lref.h
blob: aff9e18511263dd2cec42ee222f058955b20c1c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
** $Id: lref.h,v 1.2 1999/11/10 15:37:50 roberto Exp roberto $
** REF mechanism
** See Copyright Notice in lua.h
*/

#ifndef lref_h
#define lref_h

#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 (lua_State *L, const TObject *o, int lock);
const TObject *luaR_getref (lua_State *L, int ref);
void luaR_invalidaterefs (lua_State *L);


#endif