pub unsafe extern "C-unwind" fn JSObjectMakeTypedArrayWithBytesNoCopy(
ctx: JSContextRef,
array_type: JSTypedArrayType,
bytes: *mut c_void,
byte_length: usize,
bytes_deallocator: JSTypedArrayBytesDeallocator,
deallocator_context: *mut c_void,
exception: *mut JSValueRef,
) -> JSObjectRefJSBase and JSTypedArray and JSValueRef only.Expand description
Creates a JavaScript Typed Array object from an existing pointer.
Parameter ctx: The execution context to use.
Parameter arrayType: A value identifying the type of array to create. If arrayType is kJSTypedArrayTypeNone or kJSTypedArrayTypeArrayBuffer then NULL will be returned.
Parameter bytes: A pointer to the byte buffer to be used as the backing store of the Typed Array object.
Parameter byteLength: The number of bytes pointed to by the parameter bytes.
Parameter bytesDeallocator: The allocator to use to deallocate the external buffer when the JSTypedArrayData object is deallocated.
Parameter deallocatorContext: A pointer to pass back to the deallocator.
Parameter exception: A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.
Returns: A JSObjectRef Typed Array whose backing store is the same as the one pointed to by bytes or NULL if there was an error.
If an exception is thrown during this function the bytesDeallocator will always be called.
ยงSafety
ctxmust be a valid pointer.bytesmust be a valid pointer.bytes_deallocatormust be implemented correctly.deallocator_contextmust be a valid pointer.exceptionmust be a valid pointer.