MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / fiber_start

Function fiber_start

crates/fiber/src/unix.rs:225–244  ·  view source on GitHub ↗
(arg0: *mut u8, top_of_stack: *mut u8)

Source from the content-addressed store, hash-verified

223}
224
225extern "C" fn fiber_start<F, A, B, C>(arg0: *mut u8, top_of_stack: *mut u8) -> *mut u8
226where
227 F: FnOnce(A, &mut super::Suspend<A, B, C>) -> C,
228{
229 unsafe {
230 // Complete the `start_switch` AddressSanitizer handshake which would
231 // have been started in `Fiber::resume`.
232 let previous = asan::fiber_start_complete();
233
234 let inner = Suspend {
235 top_of_stack,
236 previous,
237 };
238 let initial = inner.take_resume::<A, B, C>();
239 let mut inner =
240 super::Suspend::<A, B, C>::execute(inner, initial, Box::from_raw(arg0.cast::<F>()));
241 asan::fiber_exit(&mut inner.previous);
242 inner.top_of_stack
243 }
244}
245
246impl Fiber {
247 pub fn new<F, A, B, C>(stack: &FiberStack, func: F) -> Result<Self>

Callers

nothing calls this directly

Calls 3

fiber_start_completeFunction · 0.85
fiber_exitFunction · 0.85
executeFunction · 0.50

Tested by

no test coverage detected