@hirojin @brainblasted In the `parent_XXX` functions? All those lines are unsafe, they do C/Rust translation in both directions and work on raw pointers. They have to poke into the C structs for finding the function pointer, then convert all the Rust types to something C can handle (raw pointers, enums to integers, etc), then call the C function pointer, then convert any return values (or out parameters) back to the corresponding Rust types. Each of these steps is unsafe.
They're the other side of the `unsafe extern` trampoline functions at the end of the file, which are called from C, have to do the FFI translations, call the Rust code, translate back to whatever C wants.
A Mastodon instance for cats, the people who love them, and kindness in general. We strive to be a radically inclusive safe space. By creating an account, you agree to follow our CoC.