MCPcopy Create free account
hub / github.com/endbasic/endbasic / clear

Method clear

core/src/vm/mod.rs:268–273  ·  view source on GitHub ↗

Resets runtime state (registers, heap, last error, call stack, program counter) but preserves upcall caches so the same image can continue to be executed. Note: because the program counter is also reset, callers need to either re-set it to a specific location or replace the image with one that resumes from the start.

(&mut self)

Source from the content-addressed store, hash-verified

266 /// Note: because the program counter is also reset, callers need to either re-set it to a
267 /// specific location or replace the image with one that resumes from the start.
268 pub fn clear(&mut self) {
269 self.heap.clear();
270 self.context.clear_runtime_state();
271 self.last_error = None;
272 self.pending_upcall = None;
273 }
274
275 /// Clears the current error handler without affecting execution state or captured errors.
276 pub fn clear_error_handler(&mut self) {

Callers 4

resetMethod · 0.45
clear_runtime_stateMethod · 0.45

Calls 1

clear_runtime_stateMethod · 0.80