---
title: "JSObjectMakeArrayBufferWithBytesNoCopy(_:_:_:_:_:_:)"
framework: javascriptcore
role: symbol
role_heading: Function
path: "javascriptcore/jsobjectmakearraybufferwithbytesnocopy(_:_:_:_:_:_:)"
---

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

Creates a JavaScript array buffer object from an existing pointer.

## Declaration

```swift
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 doc://com.apple.javascriptcore/documentation/JavaScriptCore/JSValueRef to store an exception in, if any. Pass NULL to discard any exception.

## Return Value

Return Value A 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

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

## See Also

### Working with Array Buffers

- [JSObjectGetArrayBufferByteLength(_:_:_:)](javascriptcore/jsobjectgetarraybufferbytelength(_:_:_:).md)
- [JSObjectGetArrayBufferBytesPtr(_:_:_:)](javascriptcore/jsobjectgetarraybufferbytesptr(_:_:_:).md)
