[PATCH 3 of 3] revlog: read index data using mmap

Ryan McElroy rm at fb.com
Wed Oct 5 13:01:12 EDT 2016


On 10/5/2016 11:50 AM, Yuya Nishihara wrote:
> with open('foo', 'wb') as fp:
>      fp.write('a')
> fp = open('foo', 'rb')
> s = mmap.mmap(fp.fileno(), 0, access=mmap.ACCESS_READ)
> with open('foo', 'wb') as fp2:
>      pass  # truncate
> print(s[0])

I was about to say "Of course it would throw an exception there" ... but 
wow, this is much worse than I expected:

 > Bus error (core dumped)




More information about the Mercurial-devel mailing list