gopher-lua icon indicating copy to clipboard operation
gopher-lua copied to clipboard

ExecutionLimit option

Open michael-say opened this issue 4 years ago • 2 comments

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 of 0 (default) indicates no limit.

michael-say avatar Aug 29 '21 10:08 michael-say

I think LState.SetContext already does what you need but in a more idomatic Go way.

Simerax avatar Sep 15 '21 09:09 Simerax

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.

michael-say avatar Sep 15 '21 11:09 michael-say