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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
ea6a66e4
Commit
ea6a66e4
authored
Jun 24, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b83afcab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
10 deletions
+32
-10
wcfs/internal/mm.pyx
wcfs/internal/mm.pyx
+6
-8
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+26
-2
No files found.
wcfs/internal/mm.pyx
View file @
ea6a66e4
...
...
@@ -35,12 +35,11 @@ cpdef enum:
MCL_FUTURE
=
mman
.
MCL_FUTURE
MCL_ONFAULT
=
mman
.
MCL_ONFAULT
# XXX there is no mman.MADV_{NORMAL,RANDOM} -> use POSIX_... as workaround
MADV_NORMAL
=
mman
.
POSIX_MADV_NORMAL
MADV_RANDOM
=
mman
.
POSIX_MADV_RANDOM
MADV_SEQUENTIAL
=
mman
.
POSIX_MADV_SEQUENTIAL
MADV_WILLNEED
=
mman
.
POSIX_MADV_WILLNEED
MADV_DONTNEED
=
mman
.
POSIX_MADV_DONTNEED
MADV_NORMAL
=
mman
.
MADV_NORMAL
MADV_RANDOM
=
mman
.
MADV_RANDOM
MADV_SEQUENTIAL
=
mman
.
MADV_SEQUENTIAL
MADV_WILLNEED
=
mman
.
MADV_WILLNEED
MADV_DONTNEED
=
mman
.
MADV_DONTNEED
# incore returns bytearray vector indicating whether page of mem is in core or not.
#
...
...
@@ -136,8 +135,7 @@ def advise(const unsigned char[::1] mem not None, int advice):
cdef
const
void
*
addr
=
&
mem
[
0
]
cdef
size_t
size
=
mem
.
shape
[
0
]
# XXX using posix_madvise, not madvise
cdef
err
=
mman
.
posix_madvise
(
<
void
*>
addr
,
size
,
advice
)
cdef
err
=
mman
.
madvise
(
<
void
*>
addr
,
size
,
advice
)
if
err
:
PyErr_SetFromErrno
(
OSError
)
...
...
wcfs/wcfs_test.py
View file @
ea6a66e4
...
...
@@ -1534,6 +1534,32 @@ def test_wcfs_remmap_on_pin():
f
.
_assertBlk
(
2
,
'hello'
,
{
wl
:
{
2
:
at1
}},
pinfunc
=
_
)
# NOTE not world
# verify that pin message is not sent for the same blk@at the second time, if
# it was already sent once.
@
func
def
test_wcfs_no_pin_twice
():
t
=
tDB
();
zf
=
t
.
zfile
defer
(
t
.
close
)
f
=
t
.
open
(
zf
)
at1
=
t
.
commit
(
zf
,
{
2
:
'c1'
})
at2
=
t
.
commit
(
zf
,
{
2
:
'c2'
})
wl
=
t
.
openwatch
()
w
=
wl
.
watch
(
zf
,
at1
,
{})
f
.
assertCache
([
0
,
0
,
0
])
f
.
assertBlk
(
2
,
'c2'
,
{
wl
:
{
2
:
at1
}})
f
.
assertCache
([
0
,
0
,
1
])
assert
w
.
pinned
==
{
2
:
at1
}
# drop file[blk] from cache, access again -> no pin message sent the second time
print
(
'
\
n
\
n
\
n
\
n
\
n
ABCDEF
\
n
\
n
\
n
'
)
mm
.
advise
(
f
.
_blk
(
2
),
mm
.
MADV_DONTNEED
)
f
.
assertCache
([
0
,
0
,
0
])
# XXX
# verify watching for 2 files over single watch link.
@
func
def
test_wcfs_watch_2files
():
...
...
@@ -1578,8 +1604,6 @@ def test_wcfs_watch_2files():
# XXX drop file[blk] from cache, access again -> no pin message sent the second time
# XXX watch with @at > head - must wait for head to become >= at
# XXX no reply to pin - killed
...
...
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