[][src]Function ffi_support::destroy_c_string

pub unsafe fn destroy_c_string(cstring: *mut c_char)

Free the memory of a string created by [rust_string_to_c] on the rust heap. If c_string is null, this is a no-op.

See the [define_string_destructor!] macro which may be used for exposing this function over the FFI.

Safety

This is inherently unsafe, since we're deallocating memory. Be sure

See documentation for [define_string_destructor!], which gives a more complete overview of the potential issues.