Parameter types and return types
All parameters and return types used in standard platform function calls are permitted except:
You cannot pass or return object parameters in functions that are called asynchronously, including objects in fixed space.
Parameters passed with asynchronous calls
Objects located in movable memory that are passed into an asynchronous call are copied into a location in non-movable memory for the duration of the asynchronous call. When the asynchronous call completes, the arguments are copied back to the original objects. If the object is not copied, the garbage collector may move the object during the call, resulting in unpredictable behavior.
Objects that are not movable and not copied include:
OSObjects that reside in operating system memory, such as those allocated using calloc
Objects that reside in fixed space
Objects are otherwise passed in the same way as platform function calls using the callWith:... protocol.
Because objects are copied during an asynchronous call, the parameters passed to the function should not be used while the asynchronous call is in progress. The contents of the parameters may be changed at any time by the asynchronous call.
Last modified date: 01/29/2015