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
494dc22c
Commit
494dc22c
authored
Jan 08, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
28f4d7d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
wcfs/internal/_wcfs.pyx
wcfs/internal/_wcfs.pyx
+16
-0
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+1
-1
No files found.
wcfs/internal/_wcfs.pyx
View file @
494dc22c
...
...
@@ -32,6 +32,7 @@ cdef extern from *:
ctypedef
bint
cbool
"bool"
from
ZODB.utils
import
p64
,
u64
from
cpython
cimport
PyBuffer_FillInfo
# XXX hack, why it is needed? (likely top-level wendelin.* redirector
#from wcfs.internal._wcfs cimport *
...
...
@@ -114,6 +115,21 @@ cdef class PyMapping:
def
__dealloc__
(
PyMapping
pywmmap
):
pywmmap
.
wmmap
=
nil
# XXX unmap too ?
property
blk_start
:
def
__get__
(
PyMapping
pywmmap
):
return
pywmmap
.
wmmap
.
blk_start
property
blk_stop
:
def
__get__
(
PyMapping
pywmmap
):
return
pywmmap
.
wmmap
.
blk_stop
()
def
__getbuffer__
(
PyMapping
pywmmap
,
Py_buffer
*
view
,
int
flags
):
# XXX do we need readonly=1 here? or let it hit SIGBUS on write access?
PyBuffer_FillInfo
(
view
,
pywmmap
,
pywmmap
.
wmmap
.
mem_start
,
pywmmap
.
wmmap
.
mem_stop
-
pywmmap
.
wmmap
.
mem_start
,
readonly
=
1
,
flags
=
flags
)
property
mem
:
def
__get__
(
PyMapping
pywmmap
)
->
memoryview
:
return
memoryview
(
pywmmap
)
def
unmap
(
PyMapping
pywmmap
):
with
nogil
:
wmmap_unmap_pyexc
(
pywmmap
.
wmmap
)
# XXX +err
...
...
wcfs/wcfs_test.py
View file @
494dc22c
...
...
@@ -1719,7 +1719,7 @@ class tMapping(object):
assert
len
(
dataok
)
<=
f
.
blksize
dataok
+=
b'
\
0
'
*
(
f
.
blksize
-
len
(
dataok
))
# trailing zeros
blkview
=
memoryview
(
t
.
mmap
.
mem
[
blk_inmmap
*
f
.
blksize
:][:
f
.
blksize
])
blkview
=
t
.
mmap
.
mem
[
blk_inmmap
*
f
.
blksize
:][:
f
.
blksize
]
# XXX first access without GIL, so that e.g. if there is timeout on
# wcfs.py side, _abort_ontimeout could run and kill WCFS.
# FIXME also test with GIL locked, since wcfs.py pinner must be itself
...
...
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