With this argument, we can control the size of the mmap created. (previously it
was always the whole file.
Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG8ed8dfbeabb9: mmap: add a size argument to mmapread
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
mercurial/util.py | ||
---|---|---|
419–422 | Why does an explicit size of 0 bail with an empty buffer, but an implicit size 0 proceed? |
mercurial/util.py | ||
---|---|---|
419–422 | 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. |
mercurial/util.py | ||
---|---|---|
419–422 | This merits a comment. I'll add one in flight. |
Why does an explicit size of 0 bail with an empty buffer, but an implicit size 0 proceed?