We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Box
For example, I see a function that is exported via extern "Rust" in cxx::brige. (deepseek-ai/3FS#11)
extern "Rust"
cxx::brige
fn create(path: &str, create: bool, prefix_len: usize, error: Pin<&mut CxxString>) -> Box<Engine> { let config = EngineConfig { path: PathBuf::from(path), create, prefix_len, }; match Engine::open(&config) { Ok(engine) => Box::new(engine), Err(e) => { error.push_str(&e.to_string()); unsafe { Box::from_raw(std::ptr::null_mut()) } } } }
unsafe { Box::from_raw(std::ptr::null_mut()) }
Is this line a UB even if the Box is exported to C++ side?
And if it is UB, what is the recommanded way to fix? Raw pointer?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
For example, I see a function that is exported via
extern "Rust"
incxx::brige
. (deepseek-ai/3FS#11)unsafe { Box::from_raw(std::ptr::null_mut()) }
Is this line a UB even if the
Box
is exported to C++ side?And if it is UB, what is the recommanded way to fix? Raw pointer?
The text was updated successfully, but these errors were encountered: