[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: ctb macro and BIT_ISCOLLECTABLE
- From: Dibyendu Majumdar <mobile@...>
- Date: Fri, 5 Jun 2015 15:35:42 +0100
On 4 June 2015 at 00:39, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>> Is there a reason why the ctb macro is used instead of ensuring that
>> the collectible types have the BIT_ISCOLLECTABLE bit set by default?
>
> Not to expose that implementation detail in the API?
>
Digging a bit further it appears that the global_State structure has
an array called mt that is indexed by the type codes, so it must rely
upon the type codes being sequential.
Didn't realize that Lua types have a metatable associated with them.
What are they used for?
Regards
Dibyendu