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

# dispatch_data_create_concat

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

```
extern dispatch_data_tdispatch_data_create_concat(dispatch_data_t data1, dispatch_data_t data2);
```

## Parameters

`data1`

The first data object to include. The memory from this object is placed at the beginning of the new data object’s memory region.

`data2`

The second data object to include. The memory from this object is added to the end of the memory from `data1`.

## Return Value

A new dispatch data object containing the concatenated memory.

## Discussion

After calling this function, it is safe to release either of the objects in `data1` or `data2`. However, be aware that the memory from those objects may not be deallocated if the newly created dispatch data object references it, as opposed to copies it.

---

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)