Contents

dispatch_data_create_subrange

Returns a new dispatch data object whose contents consist of a portion of another object’s memory region.

Declaration

extern dispatch_data_t dispatch_data_create_subrange(dispatch_data_t data, size_t offset, size_t length);

Parameters

  • data:

    The dispatch data object containing the original memory to use for the new object.

  • offset:

    A byte offset into the memory of data. This offset marks the starting point of the memory for the new object.

  • length:

    The number of bytes from offset to include in the new object.

Return Value

A new dispatch data object whose memory is a subrange of the memory associated with the object in the data parameter.

Discussion

After calling this function, it is safe to release the object in data. However, be aware that the memory from that object may not be deallocated immediately if the newly created dispatch data object references it, as opposed to copies it.

See Also

Creating a Dispatch Data Object