IndexAllocatorOwnershipImage constructor
Creates an allocator ownership image.
Implementation
IndexAllocatorOwnershipImage({
required this.capacity,
required Iterable<int> allocatedIndices,
}) : allocatedIndices = Set.unmodifiable(allocatedIndices) {
if (capacity <= 0 ||
this.allocatedIndices.any((index) => index < 0 || index >= capacity)) {
throw ArgumentError(
'Allocator capacity must be positive and contain every index.');
}
}