@@ -93,32 +93,6 @@ program, in the same manner as C.
9393unsafe_store! (p:: Ptr{Any} , x:: ANY , i:: Integer = 1 ) = pointerset (p, x, Int (i), 1 )
9494unsafe_store! {T} (p:: Ptr{T} , x, i:: Integer = 1 ) = pointerset (p, convert (T,x), Int (i), 1 )
9595
96- # unsafe pointer to string conversions (don't make a copy, unlike unsafe_string)
97- # (Cstring versions are in c.jl)
98- """
99- unsafe_wrap(String, p::Ptr{UInt8}, [length,] own=false)
100-
101- Wrap a pointer `p` to an array of bytes in a `String` object,
102- interpreting the bytes as UTF-8 encoded characters *without making a
103- copy*. The optional `length` argument indicates the length in bytes of
104- the pointer's data; if it is omitted, the data is assumed to be
105- NUL-terminated. The `own` argument optionally specifies whether Julia
106- should take ownership of the memory, calling `free` on the pointer
107- when the array is no longer referenced.
108-
109- This function is labelled "unsafe" because it will crash if `p` is not
110- a valid memory address to data of the requested length.
111-
112- See also [`unsafe_string`](@ref), which takes a pointer
113- and makes a copy of the data.
114- """
115- unsafe_wrap (:: Type{String} , p:: Union{Ptr{UInt8},Ptr{Int8}} , len:: Integer , own:: Bool = false ) =
116- ccall (:jl_array_to_string , Ref{String}, (Any,),
117- ccall (:jl_ptr_to_array_1d , Vector{UInt8}, (Any, Ptr{UInt8}, Csize_t, Cint),
118- Vector{UInt8}, p, len, own))
119- unsafe_wrap (:: Type{String} , p:: Union{Ptr{UInt8},Ptr{Int8}} , own:: Bool = false ) =
120- unsafe_wrap (String, p, ccall (:strlen , Csize_t, (Ptr{UInt8},), p), own)
121-
12296# convert a raw Ptr to an object reference, and vice-versa
12397"""
12498 unsafe_pointer_to_objref(p::Ptr)
0 commit comments