##// END OF EJS Templates
mmap: only use mmap to read revlog persistent nodemap if it is safe...
marmoute -
r52549:21442f87 stable
parent child Browse files
Show More
@@ -74,7 +74,7 b' def persisted_data(revlog):'
74 test_race_hook_1()
74 test_race_hook_1()
75 try:
75 try:
76 with revlog.opener(filename) as fd:
76 with revlog.opener(filename) as fd:
77 if use_mmap:
77 if use_mmap and revlog.opener.is_mmap_safe(filename):
78 try:
78 try:
79 data = util.buffer(util.mmapread(fd, data_length))
79 data = util.buffer(util.mmapread(fd, data_length))
80 except ValueError:
80 except ValueError:
@@ -205,7 +205,7 b' def persist_nodemap(tr, revlog, pending='
205 fd.seek(target_docket.data_length)
205 fd.seek(target_docket.data_length)
206 fd.write(data)
206 fd.write(data)
207 if feed_data:
207 if feed_data:
208 if use_mmap:
208 if use_mmap and revlog.opener.is_mmap_safe(datafile):
209 fd.flush()
209 fd.flush()
210 new_data = util.buffer(util.mmapread(fd, new_length))
210 new_data = util.buffer(util.mmapread(fd, new_length))
211 else:
211 else:
@@ -238,7 +238,7 b' def persist_nodemap(tr, revlog, pending='
238 with revlog.opener(datafile, b'w+') as fd:
238 with revlog.opener(datafile, b'w+') as fd:
239 fd.write(data)
239 fd.write(data)
240 if feed_data:
240 if feed_data:
241 if use_mmap:
241 if use_mmap and revlog.opener.is_mmap_safe(datafile):
242 fd.flush()
242 fd.flush()
243 new_data = util.buffer(util.mmapread(fd, len(data)))
243 new_data = util.buffer(util.mmapread(fd, len(data)))
244 else:
244 else:
General Comments 0
You need to be logged in to leave comments. Login now