Skip to content

Commit

Permalink
remove Complex from boot.jl and some doc edits
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Mar 10, 2015
1 parent 0130e1f commit a9dbd91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export
Box, Function, IntrinsicFunction, LambdaStaticData, Method, MethodTable,
Module, Symbol, Task, Array, GenSym,
# numeric types
Real, Complex, Number, Integer, Bool, Ref, Ptr,
Number, Real, Integer, Bool, Ref, Ptr,
FloatingPoint, Float16, Float32, Float64,
Signed, Int, Int8, Int16, Int32, Int64, Int128,
Unsigned, UInt, UInt8, UInt16, UInt32, UInt64, UInt128,
Expand Down
25 changes: 9 additions & 16 deletions doc/stdlib/c.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,28 +268,21 @@

.. data:: Ptr{T}

A simple pointer to an arbitrary memory location.
The type objects expected at the memory location is represented by the type parameter.
However, no guarantee is made or implied that the memory is actually valid,
or that it actually represents the data of the specified type.

``C_NULL`` represents a generic, invalid or "NULL" pointer.
A memory address referring to data of type ``T``.
However, there is no guarantee that the memory is actually valid,
or that it actually represents data of the specified type.

.. data:: Ref{T}

Effectively, this represents and creates a managed pointer.
The type of objects it can contain is specified by the type parameter.
An object that safely references data of type ``T``.
This type is guaranteed to point to valid, Julia-allocated memory
of the correct type (per the type parameter).

When passed to a `ccall` argument (either as a `Ptr` or `Ref` type),
the `Ref` object will be implicitly converted to a pointer to the
data region of that type.
of the correct type. The underlying data is protected from freeing by
the garbage collector as long as the ``Ref`` itself is referenced.

The ``Ref`` type is useful for creating garbage-collector safe pointers and
returning values from a function (esp. a c-function), for example.
When passed as a ``ccall`` argument (either as a ``Ptr`` or ``Ref`` type),
a ``Ref`` object will be converted to a native pointer to the data it references.

There is no generic invalid or "NULL" Ref object.
There is no invalid (NULL) ``Ref``.

.. data:: Cchar

Expand Down

0 comments on commit a9dbd91

Please sign in to comment.