Skip to content

Commit

Permalink
doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj committed Jun 7, 2016
1 parent 44d46bf commit 2f49f4b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions base/pointer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ unsafe_convert{T}(::Type{Ptr{T}}, a::AbstractArray{T}) = error("conversion to po

# unsafe pointer to array conversions
"""
unsafe_wrap(Array, pointer, dims, own=false)
unsafe_wrap(Array, pointer::Ptr{T}, dims, own=false)
Wrap a native pointer as a Julia `Array `object. The pointer element type determines the array
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.
Expand Down
2 changes: 1 addition & 1 deletion base/strings/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Copy a string from the address of a C-style (NUL-terminated) string encoded as U
This function is labelled "unsafe" because it will crash if `p` is not
a valid memory address to data of the requested length.
See also [`unsafe_string_wrapper`](:func:`unsafe_string_wrapper`), which takes a pointer
See also [`unsafe_wrap(String, p, [length])`](:func:`unsafe_wrap`), which takes a pointer
and wraps a string object around it without making a copy.
"""
function unsafe_string(p::Union{Ptr{UInt8},Ptr{Int8}}, len::Integer)
Expand Down
4 changes: 2 additions & 2 deletions doc/stdlib/c.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@

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

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

.. Docstring generated from Julia source
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.
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.

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

Expand Down
2 changes: 1 addition & 1 deletion doc/stdlib/strings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

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

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

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

Expand Down

0 comments on commit 2f49f4b

Please sign in to comment.