Array<T extends NativeType, L extends List<int> > constructor
- int length,
- L getView(
- Pointer<
T> , - int
- Pointer<
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);
}