> How to make an unsafe_string safe?

Make sure the pointer returned by the C function is valid.

On Fri, Jul 22, 2016 at 4:07 PM, Jeffrey Sarnoff
<jeffrey.sarn...@gmail.com> wrote:
> I have a ccall to a library that returns a C-string `cstr = ccall(__)`.  I
> understand that v0.5/current practice is to do `jstr = unsafe_string(cstr)`
> upon obtaining `cstr`.
> The cstr is freed by another ccall.  If I want to use or return that string
> as a Julia String type, do I need to do something more before/after freeing
> the cstr?

unsafe_string is equivalent to bytestring on 0.4. You don't need to do
anything differently.

>

Reply via email to