Skip to main content

leak_str

Function leak_str 

Source
pub fn leak_str(s: &str) -> *const c_char
Expand description

Leak a Rust &str into a *const c_char that lives forever.

This is the standard way to produce C strings for the ABI. The memory is never freed — acceptable for module descriptors and return values.