Re: no custom metamethods for cdata

  • From: Ronan Collobert <ronan@xxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 27 Mar 2014 18:37:21 +0100

> Ah, right -- you would need to use pcall for that.  I mocked up an improved 
> version here:
> 
> https://gist.github.com/neomantra/9281334
> 
> LuaJIT compiles pcall, so it's probably performant.

— No, it is not performant.

I encountered the same issue described in this thread, and I am looking for a 
solution (but speed is really critical in my case).
pcall() is compiled by luaJIT, but in what you show you create a closure (which 
is NYI http://wiki.luajit.org/NYI).
Even if you defined the closure beforehand, you still have the problem that 
getting _serialize would be only compiled if you used rawset()… but that is not 
possible here, of course. Arg.

Ronan.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Other related posts: