mpatch: Define Py_ssize_t for old pythons and use it instead of ssize_t.
See also PEP 353.
NOTE: Microsoft compilers (8 or earlier) does not have ssize_t.
mpatch: use int rather than ssize_t
We might need to be more clever than this to make Py2.5 happy.
osutil: improve portability
- manually inline mode_to_kind
- remove unused alloca include
- remove fstatat and associated bits
It's not obvious that there's an advantage to using fstatat in terms
of performance. The race-avoidance properties of fstatat aren't
terribly useful to us either. So best to avoid it until we figure out
how to use it portably.
fix UnboundLocalError, refactor a bit
bin wasn't defined in all branches (bug introduced in
82b4ff3abbcd
bdiff: tweaks for large files
- adjust the common line threshold to .1%
this speeds up a delta of 7M lines of source from 10m to 40s
- adjust the scaling of the hash array down a bit as it was raising the peak
memory usage significantly
revlog: break up compression of large deltas
Python's zlib apparently makes an internal copy of strings passed to
compress(). To avoid this, compress strings 1M at a time, then join
them at the end if the result would be smaller than the original.
For initial commits of large but compressible files, this cuts peak
memory usage nearly in half.