[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: luajit2 head and Lanes 2.07, very strange!
- From: Mike Pall <mikelu-1011@...>
- Date: Tue, 30 Nov 2010 15:42:18 +0100
zhiguo zhao wrote:
> Why I first require lanes failed, but it works after call tostring?
Nope, it doesn't really work. It probably just doesn't print the
error the 2nd time.
> > print(tostring)
> function: fast#14
Lanes tries to do some strange things with the tostring()
function. It expects this to be a plain C function which can be
called from a different state. But tostring() is not a plain C
function in LuaJIT (as you can see above).
>From looking at the Lanes source code, it seems to use the string
returned from tostring() as a key to a cache for tables. I won't
go into why that is an exceptionally bad idea -- the fact that
tostring() will call any __tostring metamethods should be enough
to discredit that approach. IOW: Lanes needs to be fixed.
--Mike