helix
helix copied to clipboard
Use the standard convention for function pointers in libcruby
Typically you never take extern "C" fn directly, as there is no way to
pass NULL there without using transmute. Bindgen and most other tools
generally use Option for this purpose.
I've also changed the alloc and free functions to use the functions
provided on box for converting to/from pointers, rather than relying on
its internal representation. There's still the transmute on the class,
but I'm not entirely sure what that's doing so I've left it alone for
now.
I'd like to discuss this with some Rust people before making this change.
Did you ever get a chance to discuss this with some Rust people?
@sgrif I did... I'm not convinced by your assertion that this is the "standard convention", nor do I know how to feel confident that Option
I called it the "standard convention", since it's what bindgen generates,
@wycats @sgrif what's the status here?
Is this superseded by #160?