<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Dispatch",
  "identifier" : "/documentation/Dispatch/dispatch_data_create_map",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Dispatch"
    ],
    "preciseIdentifier" : "c:@F@dispatch_data_create_map"
  },
  "title" : "dispatch_data_create_map"
}
-->

# dispatch_data_create_map

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

```
extern dispatch_data_tdispatch_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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)