struct
AutoreleasingUnsafeMutablePointer
<
T
>
Inheritance |
CVarArgType, DebugPrintable, Equatable, NilLiteralConvertible, _PointerType
View Protocol Hierarchy →
|
---|---|
Import |
|
Initializers
Initialize to a null pointer.
Declaration
init
()
Explicit construction from an UnsafeMutablePointer.
This is inherently unsafe; UnsafeMutablePointer assumes the referenced memory has +1 strong ownership semantics, whereas AutoreleasingUnsafeMutablePointer implies +0 semantics.
Declaration
init
<
U
>
(
_
ptr
:
UnsafeMutablePointer
<
U
>
)
Create an instance initialized with nil
.
Declaration
init
(
nilLiteral
: ())
Instance Variables
A textual representation of self
, suitable for debugging.
Declaration
var
debugDescription
:
String
{
get
}
Access the underlying raw memory, getting and setting values.
Declaration
var
memory
:
T
{
get
set
}
Subscripts
Declaration
subscript
(
i
:
Int
) -
>
T
{
get
}
Instance Methods
Transform self
into a series of machine words that can be
appropriately interpreted by C varargs
Declaration
func
encode
() -
>
[
Word
]
A mutable pointer-to-ObjC-pointer argument.
This type has implicit conversions to allow passing any of the following to a C or ObjC API:
Passing pointers to mutable arrays of ObjC class pointers is not directly supported. Unlike UnsafeMutablePointer<T>, AutoreleasingUnsafeMutablePointer must reference storage that does not own a reference count to the referenced value. UnsafeMutablePointer's operations, by contrast, assume that the referenced storage owns values loaded from or stored to it.
This type does not carry an owner pointer unlike the other C*Pointer types because it only needs to reference the results of inout conversions, which already have writeback-scoped lifetime.