copyToNative method

Pointer<Float> copyToNative({
  1. Allocator allocator = malloc,
})

Copies a Float32List into native memory as a float*.

Returns an allocator-allocated pointer to the result.

Implementation

Pointer<Float> copyToNative({Allocator allocator = malloc}) {
  final Pointer<Float> result = allocator<Float>(length)
    ..asTypedList(length).setAll(0, this);
  return result.cast();
}