CFMachPortCreate(_:_:_:_:)
Creates a CFMachPort object with a new Mach port.
Declaration
func CFMachPortCreate(_ allocator: CFAllocator!, _ callout: CFMachPortCallBack!, _ context: UnsafeMutablePointer<CFMachPortContext>!, _ shouldFreeInfo: UnsafeMutablePointer<DarwinBoolean>!) -> CFMachPort!Parameters
- allocator:
The allocator to use to allocate memory for the new object. Pass
NULLor Kcfallocatordefault to use the current default allocator. - callout:
The callback function invoked when a message is received on the new Mach port.
- context:
A structure holding contextual information for the new Mach port. The function copies the information out of the structure, so the memory pointed to by
contextdoes not need to persist beyond the function call. - shouldFreeInfo:
A flag set by the function to indicate whether the
infomember ofcontextshould be freed. The flag is set totrueon failure,falseotherwise.shouldFreeInfocan beNULL.
Return Value
The new CFMachPort object or NULL on failure. The CFMachPort object has both send and receive rights. Ownership follows the The Create Rule.