Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
b0b8350f
Commit
b0b8350f
authored
Dec 23, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6c998ca4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
6 deletions
+28
-6
bigfile/_bigfile.c
bigfile/_bigfile.c
+20
-5
bigfile/file_zodb.py
bigfile/file_zodb.py
+4
-0
bigfile/tests/test_filezodb.py
bigfile/tests/test_filezodb.py
+4
-1
No files found.
bigfile/_bigfile.c
View file @
b0b8350f
...
...
@@ -414,6 +414,20 @@ PyFunc(pyfileh_invalidate_page, "invalidate_page(pgoffset) - invalidate fileh pa
}
PyFunc
(
pyfileh_uses_mmap_overlay
,
"uses_mmap_overlay() - whether base data for all VMAs"
" of this fileh are taken as base-layer mmap"
)
(
PyObject
*
pyfileh0
,
PyObject
*
args
)
{
PyBigFileH
*
pyfileh
=
container_of
(
pyfileh0
,
PyBigFileH
,
pyobj
);
BigFileH
*
fileh
=
&
pyfileh
->
fileh
;
if
(
!
PyArg_ParseTuple
(
args
,
""
))
return
NULL
;
return
PyBool_FromLong
(
fileh
->
mmap_overlay
);
}
static
void
pyfileh_dealloc
(
PyObject
*
pyfileh0
)
{
...
...
@@ -454,11 +468,12 @@ pyfileh_new(PyTypeObject *type, PyObject *args, PyObject *kw)
static
/*const*/
PyMethodDef
pyfileh_methods
[]
=
{
{
"mmap"
,
pyfileh_mmap
,
METH_VARARGS
,
pyfileh_mmap_doc
},
{
"dirty_writeout"
,
pyfileh_dirty_writeout
,
METH_VARARGS
,
pyfileh_dirty_writeout_doc
},
{
"dirty_discard"
,
pyfileh_dirty_discard
,
METH_VARARGS
,
pyfileh_dirty_discard_doc
},
{
"isdirty"
,
pyfileh_isdirty
,
METH_VARARGS
,
pyfileh_isdirty_doc
},
{
"invalidate_page"
,
pyfileh_invalidate_page
,
METH_VARARGS
,
pyfileh_invalidate_page_doc
},
{
"mmap"
,
pyfileh_mmap
,
METH_VARARGS
,
pyfileh_mmap_doc
},
{
"dirty_writeout"
,
pyfileh_dirty_writeout
,
METH_VARARGS
,
pyfileh_dirty_writeout_doc
},
{
"dirty_discard"
,
pyfileh_dirty_discard
,
METH_VARARGS
,
pyfileh_dirty_discard_doc
},
{
"isdirty"
,
pyfileh_isdirty
,
METH_VARARGS
,
pyfileh_isdirty_doc
},
{
"invalidate_page"
,
pyfileh_invalidate_page
,
METH_VARARGS
,
pyfileh_invalidate_page_doc
},
{
"uses_mmap_overlay"
,
pyfileh_uses_mmap_overlay
,
METH_VARARGS
,
pyfileh_uses_mmap_overlay_doc
},
{
NULL
}
};
...
...
bigfile/file_zodb.py
View file @
b0b8350f
...
...
@@ -781,6 +781,10 @@ class _ZBigFileH(object):
def
invalidate_page
(
self
,
pgoffset
):
return
self
.
zfileh
.
invalidate_page
(
pgoffset
)
@
property
def
uses_mmap_overlay
(
self
):
return
self
.
zfileh
.
uses_mmap_overlay
# ~~~~ ISynchronizer ~~~~
def
beforeCompletion
(
self
,
txn
):
...
...
bigfile/tests/test_filezodb.py
View file @
b0b8350f
...
...
@@ -137,7 +137,10 @@ def test_bigfile_filezodb():
# evict all loaded pages and test loading them again
# (verifies ZBlk.loadblkdata() & loadblk logic when loading data the second time)
reclaimed
=
ram_reclaim_all
()
assert
reclaimed
>=
blen
# XXX assumes pagesize=blksize
if
fh
.
uses_mmap_overlay
:
assert
reclaimed
==
0
else
:
assert
reclaimed
>=
blen
# XXX assumes pagesize=blksize
for
i
in
xrange
(
blen
):
assert
array_equal
(
Blk
(
vma
,
i
),
dataX
(
i
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment