<!--
{
  "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_copy_region",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Dispatch"
    ],
    "preciseIdentifier" : "c:@F@dispatch_data_copy_region"
  },
  "title" : "dispatch_data_copy_region"
}
-->

# dispatch_data_copy_region

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

```
extern dispatch_data_tdispatch_data_copy_region(dispatch_data_t data, size_t location, size_t *offset_ptr);
```

## Parameters

`data`

The dispatch data object to query.

`location`

The byte offset to use when determining which memory region to return.

`offset_ptr`

On input, a pointer to a variable. On output, this variable contains the offset from the beginning of `data` of the returned memory region.

## Return Value

A dispatch data object containing a copy of the entire memory region that contains the specified location.

---

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)