gopher-lua
gopher-lua copied to clipboard
ExecutionLimit option
Fixes # (no issue created).
Changes proposed in this pull request:
- A new lua.NewState option
ExecutionLimit uint. Sets the maximum number of operations to execute. A value of0(default) indicates no limit.
I think LState.SetContext already does what you need but in a more idomatic Go way.
I think LState.SetContext already does what you need but in a more idomatic Go way.
You right, LState.SetContext provides the time limitation feature, but it's different: on various hardware the number of executed operations may seriously differ with the same timeout value.