TValue¶
lobject.h
/*
** Union of all collectable objects
*/
union GCObject {
GCheader gch;
union TString ts;
union Udata u;
union Closure cl;
struct Table h;
struct Proto p;
struct UpVal uv;
struct lua_State th; /* thread */
};
union Value {
GCObject *gc;
void *p;
lua_Number n;
int b;
};
struct TValue {
Value value; \
int tt;
void setnilvalue() { tt = LUA_TNIL; }
void setbvalue(int x) {
value.b = (x);
tt = LUA_TBOOLEAN;
}
};