FillInto method

Pointer<T> FillInto(
  1. int count,
  2. void init(
    1. int,
    2. T
    ), {
  3. String? key,
})

Fills a tracked slot of count structs by calling init(i, struct) which writes directly into the native struct fields.

Implementation

Pointer<T> FillInto(int count, void Function(int, T) init, {String? key}) {
  final p = At(_slotKey(key), count);
  for (int i = 0; i < count; i++) init(i, indexerFunc(p, i));
  return p;
}