You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

24 lines
458 B

  1. # flake8: noqa
  2. cdef inline add_flowcontrol_defaults(high, low, int kb):
  3. cdef int h, l
  4. if high is None:
  5. if low is None:
  6. h = kb * 1024
  7. else:
  8. l = low
  9. h = 4 * l
  10. else:
  11. h = high
  12. if low is None:
  13. l = h // 4
  14. else:
  15. l = low
  16. if not h >= l >= 0:
  17. raise ValueError('high (%r) must be >= low (%r) must be >= 0' %
  18. (h, l))
  19. return h, l