[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Overhead of luaJIT_setmode(L, -1, LUAJIT_MODE_WRAPCFUNC|LUAJIT_MODE_ON)
- From: Konstantin Osipov <kostja.osipov@...>
- Date: Fri, 23 Dec 2011 23:20:19 +0300
>> One way to re-implement is to turn on WRAPFUNC every time
>> pcall() is called. Is this a good solution?
> That's not how it works and not something you should do. You turn
> this option on _once_ and then leave it on.
> If you use the wrapper function given in the docs, that's all you
> need to do. No need to override pcall() etc.
Thank you for making it clear.
>> An alternative solution would look like:
> It doesn't catch regular Lua errors -- I'm not sure you want that.
> And this solution is only ok, if you call it rarely and then run
> most of the time inside the called code (without errors).
In my case it does, since I have reset lua_atpanic to
throw an exception as well.
Why is it only OK if called rarely? Is the built-in pcall()