Does `String(unsafe_wrap(cstring, len, own=true))` free the memory it points to?

AwesomeQuest
Fri, 20 Mar 2026 23:13:35 +0000
General Usage

If I have a Cstring from a @ccall that I am responsible for freeing, does converting that Cstring to a Julia String via s = String(unsafe_wrap(Vector{UInt8}, Ptr{UInt8}(cstring), len, own=true)) automatically free the associated memory once s goes out of scope?

3 posts - 3 participants