jSObjectMakeArrayBufferWithBytesNoCopy top-level property

Pointer<NativeType> Function(Pointer<NativeType> ctx, Pointer<NativeType> bytes, int byteLength, Pointer<NativeFunction<JSTypedArrayBytesDeallocator>> bytesDeallocator, Pointer<NativeType> deallocatorContext, Pointer<Pointer<NativeType>> exception) jSObjectMakeArrayBufferWithBytesNoCopy
final

Creates a JavaScript Array Buffer object from an existing pointer. If an exception is thrown during this function the bytesDeallocator will always be called. ctx (JSContextRef) The execution context to use. bytes (void*) A pointer to the byte buffer to be used as the backing store of the Typed Array object. byteLength (size_t) The number of bytes pointed to by the parameter bytes. bytesDeallocator (JSTypedArrayBytesDeallocator) The allocator to use to deallocate the external buffer when the Typed Array data object is deallocated. deallocatorContext (void*) A pointer to pass back to the deallocator. exception (JSValueRef*) A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result (JSObjectRef) A JSObjectRef Array Buffer whose backing store is the same as the one pointed to by bytes or NULL if there was an error.

Implementation

final Pointer Function(
        Pointer ctx,
        Pointer bytes,
        int byteLength,
        Pointer<NativeFunction<JSTypedArrayBytesDeallocator>> bytesDeallocator,
        Pointer deallocatorContext,
        Pointer<Pointer> exception) jSObjectMakeArrayBufferWithBytesNoCopy =
    JscFfi.lib
        .lookup<
            NativeFunction<
                Pointer Function(Pointer, Pointer, Uint32, Pointer, Pointer,
                    Pointer)>>('JSObjectMakeArrayBufferWithBytesNoCopy')
        .asFunction();