<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLMeshBufferMap/init(bytes:deallocator:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLMeshBufferMap(im)initWithBytes:deallocator:"
  },
  "title" : "init(bytes:deallocator:)"
}
-->

# init(bytes:deallocator:)

Initializes a buffer map object to manage access to the specified memory.

```
init(bytes: UnsafeMutableRawPointer, deallocator: (() -> Void)? = nil)
```

## Parameters

`bytes`

A pointer to the data buffer to be managed by the buffer map.

`deallocator`

Model I/O calls this block when the buffer map object is deallocated. Use this block to unmap a shared buffer or perform other cleanup tasks.

    The block has no parameters and no return value.

## Return Value

A new buffer map 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)