nvi-1.81.6-db.patch 690 B

123456789101112131415161718192021222324252627
  1. --- a/common/exf.c
  2. +++ b/common/exf.c
  3. @@ -228,13 +228,18 @@
  4. /*
  5. * XXX
  6. * A seat of the pants calculation: try to keep the file in
  7. - * 15 pages or less. Don't use a page size larger than 10K
  8. + * 15 pages or less. Don't use a page size larger than 8K
  9. - * (vi should have good locality) or smaller than 1K.
  10. + * (vi should have good locality) or smaller than 1K. DB asks
  11. + * for a power of two, so give it one.
  12. */
  13. psize = ((sb.st_size / 15) + 1023) / 1024;
  14. - if (psize > 10)
  15. + if (psize >= 8)
  16. - psize = 10;
  17. + psize = 8;
  18. + else if (psize >= 4)
  19. + psize = 4;
  20. + else if (psize >= 2)
  21. + psize = 2;
  22. - if (psize == 0)
  23. + else
  24. psize = 1;
  25. psize *= 1024;