---
title: "init(bytesNoCopy:count:deallocator:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/data/init(bytesnocopy:count:deallocator:)"
---

# init(bytesNoCopy:count:deallocator:)

Creates a data buffer with memory content without copying the bytes.

## Declaration

```swift
init(bytesNoCopy bytes: UnsafeMutableRawPointer, count: Int, deallocator: Data.Deallocator)
```

## Parameters

- `bytes`: A pointer to the bytes.
- `count`: The size of the bytes.
- `deallocator`: Specifies the mechanism to free the indicated buffer, or .none.

## Discussion

Discussion If the result is mutated and is not a unique reference, then the Data will still follow copy-on-write semantics. In this case, the copy will use its own deallocator. Therefore, it is usually best to only use this initializer when you either enforce immutability with let or ensure that no other references to the underlying data are formed.

## See Also

### Creating Populated Data

- [init()](foundation/data/init().md)
- [init(buffer:)](foundation/data/init(buffer:)-75sng.md)
- [init(buffer:)](foundation/data/init(buffer:)-6xgv4.md)
- [init(bytes:count:)](foundation/data/init(bytes:count:).md)
- [init(capacity:)](foundation/data/init(capacity:).md)
- [init(count:)](foundation/data/init(count:).md)
