pub fn closure_to_ptr<F, R>(func: F) -> *const c_void where
    F: FnMut() -> R,