allocate<T extends NativeType> method
- int length,
- List<
int> getView(- Pointer<
T> , - int
- Pointer<
Allocates Array of length
.
get_View
returns the typed list of Pointer<T>
Implementation
static Array allocate<T extends NativeType>(
int length, List<int> Function(Pointer<T>, int) getView) {
final ptr = ffi.allocate<T>(count: length);
final view = getView(ptr, length);
return Array._(ptr, view);
}