[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: alternative udata checking
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 2 Dec 2011 17:54:11 -0200
> Would binding the metatable as an upvalue to the methods of a 'class' not
> be faster? You could skip the table lookup altogether, just get the
> metatable from argument 1 and compare it to the upvalue to determine
> 'class' membership.
Sure, there are probably many ways to do this. The one implemented in
lauxlib is just one. Another is to keep a weak-keyed table with all
the udata created by the module and just indexed that. I haven't tried
this yet though.