getBlock method

Uint32List getBlock({
  1. required int lane,
  2. required int slice,
  3. required int index,
})

Implementation

Uint32List getBlock({
  required int lane,
  required int slice,
  required int index,
}) {
  final blocks = _blocks ??= _allocateBlocks();
  final blocksPerLane = blockCount ~/ parallelism;
  final blocksPerSegment = blocksPerLane ~/ 4;
  final blockIndex = lane * blocksPerLane + slice * blocksPerSegment + index;
  assert(
    blockIndex >= 0 && blockIndex < blocks.length,
    'blockIndex=$blockIndex, blockCount=$blockCount parallelism=$parallelism lane=$lane, slice=$slice, index=$index',
  );
  return blocks[blockIndex];
}