tov / libffi-rs

Rust bindings for libffi
Apache License 2.0
104 stars 36 forks source link

Support no_std + alloc #84

Open val3rius opened 1 year ago

val3rius commented 1 year ago

Hi!

I'm currently running a local fork of this project in order to do some FFI things in a no_std application (with alloc). Of course it'd be a lot nicer to simply rely on the upstream repo.

If you take a look at the comparison against my fork (where I put all changes behind a no_std feature flag) you see its 90% just importing things from core rather than std. Would this be something feasible to get in libffi-rs?

https://github.com/tov/libffi-rs/compare/master...val3rius:libffi-rs:no_std

Thanks a bunch!

val3rius commented 1 year ago

One problem to tackle would be that replacing std::process::abort(); with core::intrinsics::abort(); requires nightly. Perhaps there is some other way to go about that.