diff options
Diffstat (limited to 'pit/include/lcq')
| -rw-r--r-- | pit/include/lcq/pit/runtime.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pit/include/lcq/pit/runtime.h b/pit/include/lcq/pit/runtime.h index feeb267..96d0351 100644 --- a/pit/include/lcq/pit/runtime.h +++ b/pit/include/lcq/pit/runtime.h @@ -98,6 +98,7 @@ typedef struct pit_runtime { pit_vec(pit_traversal_entry) *traversal; /* intermediate stack used during tree traversal */ pit_vec(pit_callstack_entry) *callstack; /* stack of enclosing function calls */ /* bookkeeping */ + i64 fuel; /* fuel total - ignored if negative. decrements on each instruction executed. */ /* "frozen" values offsets: values before these offsets are immutable, and we can reset here later */ i64 frozen_values, frozen_symtab; pit_value error; /* error value - if this is non-nil, an error has occured! only tracks the first error */ @@ -108,6 +109,7 @@ typedef struct pit_runtime { } pit_runtime; pit_runtime *pit_runtime_new(u8 *buf, i64 len); +void pit_runtime_set_fuel(pit_runtime *rt, i64 fuel); void pit_runtime_freeze(pit_runtime *rt); /* freeze the runtime at the current point - everything currently defined becomes immutable */ void pit_runtime_reset(pit_runtime *rt); /* restore the runtime to the frozen point, resetting everything that has happened since */ bool pit_runtime_print_error(pit_runtime *rt); /* return true if an error has occured, and print to stderr */ |
