Skip to content

Commit 2f49f4b

Browse files
committed
doc fixes
1 parent 44d46bf commit 2f49f4b

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

base/pointer.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ unsafe_convert{T}(::Type{Ptr{T}}, a::AbstractArray{T}) = error("conversion to po
3636

3737
# unsafe pointer to array conversions
3838
"""
39-
unsafe_wrap(Array, pointer, dims, own=false)
39+
unsafe_wrap(Array, pointer::Ptr{T}, dims, own=false)
4040
41-
Wrap a native pointer as a Julia `Array `object. The pointer element type determines the array
41+
Wrap a Julia `Array` object around the data at the address given by `pointer`,
42+
without making a copy. The pointer element type `T` determines the array
4243
element type. `dims` is either an integer (for a 1d array) or a tuple of the array dimensions.
4344
`own` optionally specifies whether Julia should take ownership of the memory,
4445
calling `free` on the pointer when the array is no longer referenced.

base/strings/basic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Copy a string from the address of a C-style (NUL-terminated) string encoded as U
4545
This function is labelled "unsafe" because it will crash if `p` is not
4646
a valid memory address to data of the requested length.
4747
48-
See also [`unsafe_string_wrapper`](:func:`unsafe_string_wrapper`), which takes a pointer
48+
See also [`unsafe_wrap(String, p, [length])`](:func:`unsafe_wrap`), which takes a pointer
4949
and wraps a string object around it without making a copy.
5050
"""
5151
function unsafe_string(p::Union{Ptr{UInt8},Ptr{Int8}}, len::Integer)

doc/stdlib/c.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@
112112

113113
Calling ``Ref(array[, index])`` is generally preferable to this function.
114114

115-
.. function:: unsafe_wrap(Array, pointer, dims, own=false)
115+
.. function:: unsafe_wrap(Array, pointer::Ptr{T}, dims, own=false)
116116

117117
.. Docstring generated from Julia source
118118
119-
Wrap a native pointer as a Julia ``Array `object. The pointer element type determines the array element type. `dims`` is either an integer (for a 1d array) or a tuple of the array dimensions. ``own`` optionally specifies whether Julia should take ownership of the memory, calling ``free`` on the pointer when the array is no longer referenced.
119+
Wrap a Julia ``Array`` object around the data at the address given by ``pointer``\ , without making a copy. The pointer element type ``T`` determines the array element type. ``dims`` is either an integer (for a 1d array) or a tuple of the array dimensions. ``own`` optionally specifies whether Julia should take ownership of the memory, calling ``free`` on the pointer when the array is no longer referenced.
120120

121121
This function is labelled "unsafe" because it will crash if ``pointer`` is not a valid memory address to data of the requested length.
122122

doc/stdlib/strings.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
This function is labelled "unsafe" because it will crash if ``p`` is not a valid memory address to data of the requested length.
6666

67-
See also :func:`unsafe_string_wrapper`\ , which takes a pointer and wraps a string object around it without making a copy.
67+
See also :func:`unsafe_wrap`\ , which takes a pointer and wraps a string object around it without making a copy.
6868

6969
.. function:: unsafe_wrap(String, p::Ptr{UInt8}, [length,] own=false)
7070

0 commit comments

Comments
 (0)