Vendor dependencies
Let's see how I like this workflow.
This commit is contained in:
parent
34d1830413
commit
9c435dc440
7500 changed files with 1665121 additions and 99 deletions
20
vendor/cxx/src/symbols/rust_slice.rs
vendored
Normal file
20
vendor/cxx/src/symbols/rust_slice.rs
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
use crate::rust_slice::RustSlice;
|
||||
use core::mem::MaybeUninit;
|
||||
use core::ptr::{self, NonNull};
|
||||
|
||||
#[export_name = "cxxbridge1$slice$new"]
|
||||
unsafe extern "C" fn slice_new(this: &mut MaybeUninit<RustSlice>, ptr: NonNull<()>, len: usize) {
|
||||
let this = this.as_mut_ptr();
|
||||
let rust_slice = RustSlice::from_raw_parts(ptr, len);
|
||||
unsafe { ptr::write(this, rust_slice) }
|
||||
}
|
||||
|
||||
#[export_name = "cxxbridge1$slice$ptr"]
|
||||
unsafe extern "C" fn slice_ptr(this: &RustSlice) -> NonNull<()> {
|
||||
this.as_non_null_ptr()
|
||||
}
|
||||
|
||||
#[export_name = "cxxbridge1$slice$len"]
|
||||
unsafe extern "C" fn slice_len(this: &RustSlice) -> usize {
|
||||
this.len()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue