Skip to content
Snippets Groups Projects
Commit 81b78a91 authored by Scott Chacon's avatar Scott Chacon
Browse files

imported patch mmap-fix

parent f8f975c7
No related branches found
No related tags found
No related merge requests found
......@@ -114,9 +114,14 @@
:param access: Access mechanism.
:return: MMAP'd area.
"""
mem = mmap.mmap(f.fileno(), size+offset, access=access)
return mem, offset
print f, offset, size
if supports_mmap_offset:
mem = mmap.mmap(f.fileno(), size + offset % mmap.PAGESIZE, access=access,
offset=offset / mmap.PAGESIZE * mmap.PAGESIZE)
return mem, offset % mmap.PAGESIZE
else:
mem = mmap.mmap(f.fileno(), size+offset, access=access)
return mem, offset
def load_pack_index(filename):
f = open(filename, 'r')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment