Commit 6f4f0296 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b5211351
......@@ -108,9 +108,11 @@ class _Mapping(object):
# .file _File
# .blk_start offset of this mapping in file
# .mem mmaped memory
pass
# XXX property .blk_stop = blk_start + len(mem) // blksize & assert len(mem) % blksize == 0
@property
def blk_stop(mmap):
assert len(mmap.mem) % mmap.file.blksize == 0
return mmap.blk_start + len(mmap.mem) // mmap.file.blksize
# connect creates new Conn viewing WCFS state as of @at.
......
......@@ -1704,9 +1704,13 @@ def test_wcfspy_virtmem():
wconn = t.wc.connect(at1)
defer(wconn.close)
m1 = wconn.mmap(zf._p_oid, 2, 2)
m1 = wconn.mmap(zf._p_oid, 2, 3)
defer(m1.unmap)
assert m1.blk_start == 2
assert m1.blk_stop == 5
assert len(m1.mem) == 3*zf.blksize
# ---- misc ---
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment