<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "JavaScriptCore",
  "identifier" : "/documentation/JavaScriptCore/JSObjectMakeArrayBufferWithBytesNoCopy(_:_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "JavaScriptCore"
    ],
    "preciseIdentifier" : "c:@F@JSObjectMakeArrayBufferWithBytesNoCopy"
  },
  "title" : "JSObjectMakeArrayBufferWithBytesNoCopy(_:_:_:_:_:_:)"
}
-->

# JSObjectMakeArrayBufferWithBytesNoCopy(_:_:_:_:_:_:)

Creates a JavaScript array buffer object from an existing pointer.

```
func JSObjectMakeArrayBufferWithBytesNoCopy(_ ctx: JSContextRef!, _ bytes: UnsafeMutableRawPointer!, _ byteLength: Int, _ bytesDeallocator: JSTypedArrayBytesDeallocator!, _ deallocatorContext: UnsafeMutableRawPointer!, _ exception: UnsafeMutablePointer<JSValueRef?>!) -> JSObjectRef!
```

## Parameters

`ctx`

The execution context to use.

`bytes`

A pointer to the byte buffer to use as the backing store of the typed array object.

`byteLength`

The number of bytes that `bytes` points to.

`bytesDeallocator`

The allocator to use to deallocate the external buffer when deallocating the typed array object.

`deallocatorContext`

A pointer to pass back to the deallocator.

`exception`

A pointer to a [`JSValueRef`](/documentation/JavaScriptCore/JSValueRef) to store an exception in, if any. Pass `NULL` to discard any exception.

## Return Value

A [`JSObjectRef`](/documentation/JavaScriptCore/JSObjectRef) array buffer with a backing store that is the same as the one that `bytes` points to, or `NULL` if there is an error.

## Discussion

If the system throws an exception during this function, it always calls the `bytesDeallocator`.

---

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)