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
f3cb4f8f
Commit
f3cb4f8f
authored
Mar 14, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
4952bf86
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
wcfs/mman.pyx
wcfs/mman.pyx
+6
-8
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+5
-2
No files found.
wcfs/mman.pyx
View file @
f3cb4f8f
...
...
@@ -29,13 +29,11 @@ cdef extern from "<sys/user.h>":
cpdef
enum
:
PAGE_SIZE
cdef
extern
from
"<sys/mman.h>"
:
cpdef
enum
:
MLOCK_ONFAULT
# XXX not in posix.mman
int
mlock2
(
const
void
*
addr
,
size_t
len
,
int
flags
)
cpdef
enum
:
MLOCK_ONFAULT
=
mman
.
MLOCK_ONFAULT
MCL_CURRENT
=
mman
.
MCL_CURRENT
MCL_FUTURE
=
mman
.
MCL_FUTURE
MCL_ONFAULT
=
mman
.
MCL_ONFAULT
# mincore returns bytearray vector indicating whether page of mem is in core or not.
#
...
...
@@ -66,7 +64,7 @@ def mlock(const unsigned char[::1] mem not None, int flags):
cdef
const
void
*
addr
=
&
mem
[
0
]
cdef
size_t
size
=
mem
.
shape
[
0
]
cdef
err
=
mlock2
(
addr
,
size
,
flags
)
cdef
err
=
m
man
.
m
lock2
(
addr
,
size
,
flags
)
if
err
:
PyErr_SetFromErrno
(
OSError
)
...
...
wcfs/wcfs_test.py
View file @
f3cb4f8f
...
...
@@ -39,8 +39,11 @@ from zodbtools.util import ashex as h, fromhex
from
pytest
import
raises
from
.
import
mman
#print(mman.PAGE_SIZE)
#mman.mincore(bytearray(b'hello world'))
print
(
mman
.
PAGE_SIZE
)
print
(
mman
.
MLOCK_ONFAULT
)
print
(
mman
.
MCL_CURRENT
)
print
(
mman
.
MCL_ONFAULT
)
mman
.
mincore
(
bytearray
(
b'hello world'
))
# setup:
# - create test database, compute zurl and mountpoint for wcfs
...
...
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