[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Suggestion: upvalues to C hook functions
- From: Asko Kauppi <askok@...>
- Date: Wed, 18 Apr 2007 16:37:46 +0300
Thanks, er... yes. :)
But you didn't indicate whether that would have chances of "getting
through".. It's not a real big deal, just a slow-down when
cancellable Lua Lanes are being used. Thanks for considering.
Luiz Henrique de Figueiredo kirjoitti 18.4.2007 kello 16:04:
The current API does not allow giving upvalues to the hook function
from C API. This would be required in multithreading scenarios where
several Lua states may be using the same lua_Hook function.
What you want is a closure not upvalues. Hook functions are not Lua
functions and so cannot have upvalues. So a better and equivalent API
would be to sethook to receive a void* just like reader functions.