lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Feb 25, 2009 at 3:52 PM, Alexander Gladysh <agladysh@gmail.com> wrote:
> ...OTOH, it may make sense to have centralized abstract "operation
> counter" with C API to increment it and to set hook on it a-la
> instruction counter. Standard Lua libraries would increment them at
> will. Instruction counter would be incremented in parallel with it.
> Any sandbox-friendly 3rd party modules would increment the counter as
> well on long operation loops. It would allow to register long
> iterative operations for a sandbox in a centralized way.

I've also thought it would be useful to have a sort of generic C API
call to act as an instruction count increment which would decrement
L->hookcount and possibly run the debug hook in the same way executing
the next bytecode instruction does.

-- 
-Patrick Donnelly

"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."