MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / restore

Method restore

flow-rs/src/loader/python/context.rs:58–67  ·  view source on GitHub ↗
(&mut self, id: usize)

Source from the content-addressed store, hash-verified

56 }
57
58 fn restore(&mut self, id: usize) {
59 unsafe {
60 let context = self.pool.get_unchecked_mut(id);
61 ffi::PyThreadState_Swap(context.thread);
62 unlimited::restore(context.thread, &context.ctx);
63 context.thread = std::ptr::null_mut();
64 context.ctx = Default::default();
65 }
66 self.freelist.push(id);
67 }
68}

Callers 1

with_contextFunction · 0.80

Calls 2

restoreFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected