[][src]Function sn_ffi_utils::vec_into_raw_parts

pub fn vec_into_raw_parts<T>(v: Vec<T>) -> (*mut T, usize)

Consumes a Vec and transfers ownership of the data to a C caller, returning (pointer, size).

The pointer which this function returns must be returned to Rust and reconstituted using vec_from_raw_parts to be properly deallocated. Specifically, one should not use the standard C free() function to deallocate this data.

Failure to call vec_from_raw_parts will lead to a memory leak.