lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>there are lua objects,just not gc object.
LUA_TBOOLEAN、LUA_TLIGHTUSERDATA and LUA_TNUMBER are not gc objects?

On Tue, Oct 20, 2020 at 6:44 PM yang chao <yangchao1p@live.com> wrote:
>
> there are lua objects,just not gc object.
>
> > 在 2020年10月20日,下午5:10,孙世龙 sunshilong <sunshilong369@gmail.com> 写道:
> >
> > As per the comments in the lstate.h, which says that:
> > /*
> > ** macro to convert a Lua object into a GCObject
> > ** (The access to 'tt' tries to ensure that 'v' is actually a Lua object.)
> > */
> > #define obj2gco(v)  check_exp((v)->tt >= LUA_TSTRING, &(cast_u(v)->gc)).
> >
> > If I understand the comments correctly, I can draw the conclusion that
> > LUA_TBOOLEAN and LUA_TLIGHTUSERDATA and LUA_TNUMBER are not Lua
> > objects.
> >
> > So, what's a Lua object?
> > Why LUA_TBOOLEAN、LUA_TLIGHTUSERDATA and LUA_TNUMBER are not Lua objects?
> >
> > Best regards
> > Sunshilong