News for hackers. Stuff that matters.
Re:Rust FFI: Sending strings to the outside world by masklinn on Sunday May 14, 2017 @03:34PM (#14337159)
> First, we store the Pointer of s string in a variable (p).

> Then we use std::mem::forget to release it from the responsibility of Rust.

CString::into_raw does that whole song and dance for you.

For Vectors you probably want to convert them to boxed slices first, at which point you can use Box::into_raw (to get the slice's head pointer).

There are no comments on this comment yet.