---
title: "init(bytesNoCopy:deallocator:)"
framework: dispatch
role: symbol
role_heading: Initializer
path: "dispatch/dispatchdata/init(bytesnocopy:deallocator:)-vfoe"
---

# init(bytesNoCopy:deallocator:)

Creates a new dispatch data object using the specified memory buffer and deallocator.

## Declaration

```swift
init(bytesNoCopy bytes: UnsafeRawBufferPointer, deallocator: DispatchData.Deallocator = .free)
```

## Parameters

- `bytes`: A contiguous buffer of memory containing the initial data.
- `deallocator`: The deallocator responsible for releasing the memory associated with the data object. For a list of possible options, see doc://com.apple.dispatch/documentation/Dispatch/DispatchData/Deallocator.

## See Also

### Creating a Dispatch Data Structure

- [init(bytes:)](dispatch/dispatchdata/init(bytes:)-9lrd.md)
- [withUnsafeBytes(body:)](dispatch/dispatchdata/withunsafebytes(body:).md)
- [DispatchData.Deallocator](dispatch/dispatchdata/deallocator.md)
- [empty](dispatch/dispatchdata/empty.md)
