D7808: mmap: add a size argument to mmapread

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Tue Jan 7 13:20:11 EST 2020


marmoute added inline comments.

INLINE COMMENTS

> mharbison72 wrote in util.py:419-422
> Why does an explicit size of 0 bail with an empty buffer, but an implicit size 0 proceed?

passing 0 in `mmap.mmap(fd, 0, access=mmap.ACCESS_READ)` get you "all the byte you can eat". That's is not 0 sized mmap.

The `size` argument for `util.mmapread` is (after this patch). If size is None "all you can eat". if size is specified: provided exactly that amount of bytes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7808/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7808

To: marmoute, #hg-reviewers
Cc: mharbison72, mercurial-devel


More information about the Mercurial-devel mailing list