typedArrayBytesDeallocatorCallbackDartToNativeConverter function

NativeCallable<JSTypedArrayBytesDeallocator_> typedArrayBytesDeallocatorCallbackDartToNativeConverter(
  1. JSTypedArrayBytesDeallocator? convertToType,
  2. int len
)

Implementation

NativeCallable<JSTypedArrayBytesDeallocator_>
typedArrayBytesDeallocatorCallbackDartToNativeConverter(
  JSTypedArrayBytesDeallocator? convertToType,
  int len,
) {
  return NativeCallable.listener((
    Pointer<Void> bytes,
    Pointer<Void> deallocatorContext,
  ) {
    return convertToType?.call(
      bytes.toUint8List(len),
      deallocatorContext.toUint8List(len),
    );
  });
}