Creates a new descriptor that uses a memory buffer supplied by the caller.
- macOS 10.2+
- Core Services
The descriptor type for the new descriptor.
A pointer to the data for the new descriptor. The memory that is pointed to cannot be a
Handle(which may move in memory), cannot be modified by the caller, and must be preserved in place (and not freed), until the
disposefunction is called.
If possible, the descriptor will be mapped into the address space of the recipient using shared memory, avoiding an actual memory copy.
The pointer that is passed in does not need to be aligned to any particular boundary, but is optimized to transfer data on a page boundary. You can get the current page size (4096 on all current macOS systems) with the
man 3 getpagesizein a Terminal window for documentation.)
The length, in bytes, of the data for the new descriptor.
A universal procedure pointer to a dispose callback function of type
AEDispose. Your callback function will be called when the block of memory provided by
External Proc Ptr
datais no longer needed by the Apple Event Manager. The function can be called at any time, including during creation of the descriptor.
A reference constant the Apple Event Manager passes to the
disposefunction whenever it calls the function. If your dispose function doesn’t require a reference constant, pass 0 for this parameter.
A pointer to a descriptor. On successful return, a descriptor that incorporates the data specified by the
dataparameter. On error, a null descriptor. If the function returns successfully, your application should call the
AEDisposefunction to dispose of the resulting descriptor after it has finished using it.
A result code. See Result Codes.
This function is different than
AECreate, in that it creates a descriptor that uses the data block provided by the caller “in place,” rather than allocate a block of memory and copy the data to it. This function can provide dramatically improved performance if you’re working with large chunks of data. It attempts to copy the descriptor to the address space of any recipient process using virtual memory APIs, avoiding an actual memory copy. For example, you might want to use this function to pass a large image in an Apple event.
You can use the
AEGet function to access a specific section of a large block of data.
Thread safe starting in OS X v10.2.