[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: What's a Lua object? Why LUA_TBOOLEAN and LUA_TLIGHTUSERDATA and LUA_TNUMBER are not Lua objects?
- From: Francisco Olarte <folarte@...>
- Date: Tue, 20 Oct 2020 13:25:52 +0200
Sunshilong:
On Tue, Oct 20, 2020 at 1:04 PM 孙世龙 sunshilong <sunshilong369@gmail.com> wrote:
> >there are lua objects,just not gc object.
> LUA_TBOOLEAN、LUA_TLIGHTUSERDATA and LUA_TNUMBER are not gc objects?
What the OP probably was going to tell you is they do not need to be
treated the same way by the GC. A lua value is normally stored using
nan tagging or similar techniques in a , say, 64 bit location. Those
three just use the location, be it a table position, a uservalue, a
local, a stack position, you do not need more than clearing it when
done. OTOH strings, userdata and tables have other memory associated
with them, so they need extra treatment when becoming garbage.
If you have not easily identified that, may be you are reading in a
too advanced area of the Lua sources. I have not read it too much and
your original question seemed obvious.
FOS.