Xudong-Huang / generator-rs

rust stackful generator library
Apache License 2.0
303 stars 37 forks source link

bootstrap_green_task uses C abi but InitFn is Rust abi #46

Closed LaoLittle closed 1 year ago

LaoLittle commented 1 year ago

src/reg_context.rs

// first argument is task handle, second is thunk ptr
pub type InitFn = fn(usize, *mut usize) -> !;

src/gen_impl.rs

/// the init function passed to reg_context
fn gen_init(_: usize, f: *mut usize) -> ! {
Xudong-Huang commented 1 year ago

Thanks! now it looks like this

pub type InitFn = extern "C" fn(usize, *mut usize) -> !;