Array<T extends NativeType, L extends List<int>> constructor

Array<T extends NativeType, L extends List<int>>(
  1. int length,
  2. L getView(
    1. Pointer<T>,
    2. int
    )
)

Allocates Array of length. getView returns the typed list of Pointer<T>

Implementation

factory Array(int length, L Function(Pointer<T>, int) getView) {
  final ptr = allocate<T>(count: length);
  final view = getView(ptr, length);
  return Array.fromPtr(ptr, view);
}