func advanced(by: Int) -> UnsafeMutableRawPointer
func alignedDown<T>(for: T.Type) -> UnsafeMutableRawPointer
Obtain the preceding pointer properly aligned to store a value of type T
.
func alignedDown(toMultipleOf: Int) -> UnsafeMutableRawPointer
Obtain the preceding pointer whose bit pattern is a multiple of alignment
.
func alignedUp<T>(for: T.Type) -> UnsafeMutableRawPointer
Obtain the next pointer properly aligned to store a value of type T
.
func alignedUp(toMultipleOf: Int) -> UnsafeMutableRawPointer
Obtain the next pointer whose bit pattern is a multiple of alignment
.
func assumingMemoryBound<T>(to: T.Type) -> UnsafeMutablePointer<T>
Returns a typed pointer to the memory referenced by this pointer, assuming that the memory is already bound to the specified type.
func bindMemory<T>(to: T.Type, capacity: Int) -> UnsafeMutablePointer<T>
Binds the memory to the specified type and returns a typed pointer to the bound memory.
func copyMemory(from: UnsafeRawPointer, byteCount: Int)
Copies the specified number of bytes from the given raw pointer’s memory into this pointer’s memory.
func deallocate()
Deallocates the previously allocated memory block referenced by this pointer.
func initializeMemory<T>(as: T.Type, from: UnsafePointer<T>, count: Int) -> UnsafeMutablePointer<T>
Initializes the memory referenced by this pointer with the values starting at the given pointer, binds the memory to the values’ type, and returns a typed pointer to the initialized memory.
func initializeMemory<T>(as: T.Type, repeating: T, count: Int) -> UnsafeMutablePointer<T>
Initializes the memory referenced by this pointer with the given value, binds the memory to the value’s type, and returns a typed pointer to the initialized memory.
func initializeMemory<T>(as: T.Type, to: consuming T) -> UnsafeMutablePointer<T>
Initializes the memory referenced by this pointer with the given value, binds the memory to the value’s type, and returns a typed pointer to the initialized memory.
func load<T>(fromByteOffset: Int, as: T.Type) -> T
Returns a new instance of the given type, constructed from the raw memory at the specified offset.
func loadUnaligned<T>(fromByteOffset: Int, as: T.Type) -> T
Returns a new instance of the given type, constructed from the raw memory at the specified offset.
func moveInitializeMemory<T>(as: T.Type, from: UnsafeMutablePointer<T>, count: Int) -> UnsafeMutablePointer<T>
Initializes the memory referenced by this pointer with the values starting at the given pointer, binds the memory to the values’ type, deinitializes the source memory, and returns a typed pointer to the newly initialized memory.
func storeBytes<T>(of: T, toByteOffset: Int, as: T.Type)
Stores the given value’s bytes into raw memory at the specified offset.
func storeBytes<T>(of: T, toByteOffset: Int, as: T.Type)
Stores the given value’s bytes into raw memory at the specified offset.
func withMemoryRebound<T, E, Result>(to: T.Type, capacity: Int, (UnsafeMutablePointer<T>) throws(E) -> Result) throws(E) -> Result
Executes the given closure while temporarily binding memory to the specified number of instances of type T
.