3 ms·
Doesn't you will have the same issue, a C-like interface. Maybe I missed something, but Rust and ffi mean you use a C interface from C++ ? The only C++<->Rust
by Narew 4y ago
Doesn't you will have the same issue, a C-like interface.
Maybe I missed something, but Rust and ffi mean you use a C interface from C++ ?
The only C++<->Rust I know is either using C intermediate code or using cxx.rs but the support is limited ?
- chaosprint 4y agoYes. But we can do it in the last step, right? #[no_mangle] pub extern "C" fn process( in_ptr: *mut f32, out_ptr: *mut f32, size: usize, result_ptr: \*mut u8 ) { let _in_buf: &mut [f32] = unsafe { std::slice::from_raw_parts_mut(in_ptr, size) }; }