AVIO
public enum AVIO
Undocumented
-
Allocate a memory block with alignment suitable for all memory accesses (including vectors if available on the CPU).
Declaration
Swift
public static func malloc(size: Int) -> UnsafeMutableRawPointer?Parameters
sizeSize in bytes for the memory block to be allocated
Return Value
Pointer to the allocated block, or
nilif the block cannot be allocated. -
Allocate a memory block with alignment suitable for all memory accesses (including vectors if available on the CPU) and zero all the bytes of the block.
Declaration
Swift
public static func mallocz(size: Int) -> UnsafeMutableRawPointer?Parameters
sizeSize in bytes for the memory block to be allocated
Return Value
Pointer to the allocated block, or
nilif the block cannot be allocated. -
Allocate, reallocate, or free a block of memory.
If
ptrisnilandsize> 0, allocate a new block. Ifsizeis zero, free the memory block pointed to byptr. Otherwise, expand or shrink that block of memory according tosize.Warning
Unlike
malloc(size:), the returned pointer is not guaranteed to be correctly aligned.Declaration
Swift
public static func realloc(_ ptr: UnsafeMutableRawPointer?, size: Int) -> UnsafeMutableRawPointer?Parameters
ptrPointer to a memory block already allocated with
realloc(_:size:)ornilsizeSize in bytes of the memory block to be allocated or reallocated
Return Value
Pointer to a newly-reallocated block or
nilif the block cannot be reallocated or the function is used to free the memory block -
Free a memory block which has been allocated with a function of
malloc(size:)orrealloc(_:size:)family.Note
ptr = nilis explicitly allowed.Note
It is recommended that you use
freep(_:)instead, to prevent leaving behind dangling pointers.Declaration
Swift
public static func free(_ ptr: UnsafeMutableRawPointer?)Parameters
ptrPointer to the memory block which should be freed.
-
Free a memory block which has been allocated with a function of
malloc(size:)orrealloc(_:size:)family, and set the pointer pointing to it tonil.Note
*ptr = NULLis safe and leads to no action.Declaration
Swift
public static func freep(_ ptr: UnsafeMutableRawPointer?)Parameters
ptrPointer to the pointer to the memory block which should be freed
-
Read the file with name, and put its content in a newly allocated buffer or map it with
mmap()when available. In case of success setbufferto the read or mmapped buffer, andsizeto the size in bytes of the buffer. Unlike mmap this function succeeds with zero sized files, in this case*bufptrwill be set toniland*sizewill be set to 0. The returned buffer must be released withfileUnmap(buffer:size:).Throws
AVErrorDeclaration
Swift
public static func fileMap( filename: String, buffer: UnsafeMutablePointer<UnsafeMutablePointer<UInt8>?>, size: UnsafeMutablePointer<Int> ) throws -
Unmap or free the buffer bufptr created by
fileMap(filename:buffer:size).Declaration
Swift
public static func fileUnmap(buffer: UnsafeMutablePointer<UInt8>, size: Int) -
Move or rename a resource.
Note
srcanddstshould share the same protocol and authority.Throws
AVError
Declaration
Swift
public static func move(_ src: String, _ dst: String) throwsParameters
srcurl to resource to be moved
dstnew url to resource if the operation succeeded
-
Delete a resource.
Throws
AVErrorDeclaration
Swift
public static func delete(_ url: String) throwsParameters
urlresource to be deleted.
View on GitHub
Install in Dash
AVIO Enumeration Reference