struct
UnsafePointer
<
Memory
>
Inheritance |
BidirectionalIndexType, CVarArgType, Comparable, CustomDebugStringConvertible, Equatable, ForwardIndexType, Hashable, NilLiteralConvertible, RandomAccessIndexType, Strideable, _Incrementable, _PointerType, _RandomAccessAmbiguity, _Reflectable, _Strideable
View Protocol Hierarchy →
|
---|---|
Associated Types |
|
Import |
|
Initializers
Construct a null pointer.
Declaration
init
()
Convert from an opaque C pointer to a typed pointer.
This is a fundamentally unsafe conversion.
Declaration
init
(
_
other
:
COpaquePointer
)
Convert from an UnsafeMutablePointer
of a different type.
This is a fundamentally unsafe conversion.
Declaration
init
<
U
>
(
_
from
:
UnsafeMutablePointer
<
U
>
)
Convert from a UnsafePointer
of a different type.
This is a fundamentally unsafe conversion.
Declaration
init
<
U
>
(
_
from
:
UnsafePointer
<
U
>
)
Construct an UnsafePointer
from a given address in memory.
This is a fundamentally unsafe conversion.
Declaration
init
(
bitPattern
:
Int
)
Construct an UnsafePointer
from a given address in memory.
This is a fundamentally unsafe conversion.
Declaration
init
(
bitPattern
:
UInt
)
Create an instance initialized with nil
.
Declaration
init
(
nilLiteral
: ())
Instance Variables
A textual representation of self
, suitable for debugging.
Declaration
var
debugDescription
:
String
{
get
}
The hash value.
Axiom: x == y
implies x.hashValue == y.hashValue
.
Note: The hash value is not guaranteed to be stable across different invocations of the same program. Do not persist the hash value across program runs.
Declaration
var
hashValue
:
Int
{
get
}
Access the underlying raw memory, getting values.
Declaration
var
memory
:
Memory
{
get
}
Subscripts
Declaration
subscript
(
i
:
Int
) -
>
Memory
{
get
}
Instance Methods
Declaration
func
advancedBy
(
n
:
Int
) -
>
UnsafePointer
<
Memory
>
Declared In
UnsafePointer
, RandomAccessIndexType
, BidirectionalIndexType
, _RandomAccessAmbiguity
, ForwardIndexType
Declaration
func
advancedBy
(
n
:
UnsafePointer
<
Memory
>
.
Distance
,
limit
:
UnsafePointer
<
Memory
>
) -
>
UnsafePointer
<
Memory
>
Declared In
RandomAccessIndexType
, BidirectionalIndexType
, ForwardIndexType
Declaration
func
distanceTo
(
x
:
UnsafePointer
<
Memory
>
) -
>
Int
Declared In
UnsafePointer
, RandomAccessIndexType
, BidirectionalIndexType
, ForwardIndexType
Returns the previous consecutive value before self
.
Requires: The previous value is representable.
Declaration
func
predecessor
() -
>
UnsafePointer
<
Memory
>
Return the sequence of values (start
, start + stride
, start +
stride + stride
, ... last) where last is the last value in
the progression less than or equal to end
.
Note: There is no guarantee that end
is an element of the sequence.
Declaration
func
stride
(
through
end
:
UnsafePointer
<
Memory
>
,
by
stride
:
UnsafePointer
<
Memory
>
.
Stride
) -
>
StrideThrough
<
UnsafePointer
<
Memory
>
>
Declared In
RandomAccessIndexType
, Strideable
Return the sequence of values (self
, self + stride
, self +
stride + stride
, ... last) where last is the last value in
the progression that is less than end
.
Declaration
func
stride
(
to
end
:
UnsafePointer
<
Memory
>
,
by
stride
:
UnsafePointer
<
Memory
>
.
Stride
) -
>
StrideTo
<
UnsafePointer
<
Memory
>
>
Declared In
RandomAccessIndexType
, Strideable
Returns the next consecutive value after self
.
Requires: The next value is representable.
Declaration
func
successor
() -
>
UnsafePointer
<
Memory
>
3 inherited items hidden. (Show all)
A pointer to an object of type
Memory
. This type provides no automated memory management, and therefore the user must take care to allocate and free memory appropriately.The pointer should be aligned to
alignof(Memory.self)
.The pointer can be in one of the following states:
memory is not allocated (for example, pointer is null, or memory has been deallocated previously);
memory is allocated, but value has not been initialized;
memory is allocated and value is initialized.