Extension methods to help with Rust FFI strings and vecs

This commit is contained in:
2025-11-28 04:24:34 -07:00
parent c97c5763ae
commit 4ac2e6408f
4 changed files with 74 additions and 1 deletions

View File

@@ -155,4 +155,3 @@ fn test_spilled_variable_update_in_branch() -> anyhow::Result<()> {
Ok(())
}

View File

@@ -69,6 +69,16 @@ pub fn tokenize_line(input: safer_ffi::char_p::char_p_ref<'_>) -> safer_ffi::Vec
tokens.into()
}
#[ffi_export]
pub fn free_ffi_token_vec(v: safer_ffi::Vec<FfiToken>) {
drop(v)
}
#[ffi_export]
pub fn free_string(s: safer_ffi::String) {
drop(s)
}
#[cfg(feature = "headers")]
pub fn generate_headers() -> std::io::Result<()> {
::safer_ffi::headers::builder()