Contents

dispatch_data_create_map

Returns a new dispatch data object containing a contiguous representation of the specified object’s memory.

Declaration

extern dispatch_data_t dispatch_data_create_map(dispatch_data_t data, const void **buffer_ptr, size_t *size_ptr);

Parameters

  • data:

    A dispatch data object containing the memory to map. If the object contains multiple noncontiguous memory regions, those regions are copied to a single, contiguous memory region for the new object.

  • buffer_ptr:

    On input, a pointer to a variable in which to store the pointer to the memory region for the newly created dispatch data object. You may specify NULL for this parameter if you do not need the information.

  • size_ptr:

    On input, a pointer to a variable in which to store the size of the contiguous memory region in the newly created dispatch data object. You may specify NULL for this parameter if you do not need the information.

Return Value

A new dispatch data object containing the contiguous version of the memory managed by the object in the data parameter.

Discussion

If you specify non-NULL values for buffer_ptr or size_ptr, the values returned in those variables are valid only until you release the newly created dispatch data object. You can use these values as a quick way to access the data of the new data object.

See Also

Creating a Dispatch Data Object