code: func (a *MinMaxAllocator) SetRange(min, max int) error {
  	if min > max {
  		return ErrInvalidRange
  	}
  
  	a.lock.Lock()
  	defer a.lock.Unlock()
  
  	// Check if we need to change
  	if a.min == min && a.max == max {
  		return nil
  	}
  
  	a.min = min
  	a.max = max
  
  	// Recompute how many free we have in the range
  	numUsed := 0
  	for i := range a.used {
  		if a.inRange(i) {
  			numUsed++
  		}
  	}
  	a.free = 1 + max - min - numUsed
  
  	return nil
  }
docs: //SetRange defines the range/pool with provided min and max values.