Dispatch Data

An object that manages a memory-based data buffer and exposes it as a contiguous block of memory.


The memory buffer managed by this object may be a single contiguous block of memory, or it may consist of multiple discontiguous blocks. For the discontiguous case, the dispatch data object makes it appear as if the memory is contiguous.


Creating a Dispatch Data Object


Creates a new dispatch data object with the specified memory buffer.


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


Returns a new dispatch data object consisting of the concatenated data from two other data objects.


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


Returns a data object containing a portion of the data in another data object.


A dispatch data object representing a zero-length memory region.


An immutable object representing a contiguous or sparse region of memory.


The default data destructor for dispatch objects.


The destructor for dispatch data objects whose memory buffer was created using the malloc family of allocation routines.

Getting the Number of Elements


Returns the logical size of the memory managed by a dispatch data object

Applying Changes to the Data


Traverses the memory of a dispatch data object and executes custom code on each region.


A block to invoke for every contiguous memory region in a data object.

See Also

System Event Monitoring

Dispatch Source

An object that coordinates the processing of specific low-level system events, such as file-system events, timers, and UNIX signals.

Dispatch I/O

An object that manages operations on a file descriptor using either stream-based or random-access semantics.