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
5d26bb3e
Commit
5d26bb3e
authored
Dec 19, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c9df6fe7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
bigfile/_bigfile.c
bigfile/_bigfile.c
+10
-6
bigfile/_bigfile.h
bigfile/_bigfile.h
+5
-0
bigfile/_file_zodb.pyx
bigfile/_file_zodb.pyx
+2
-0
No files found.
bigfile/_bigfile.c
View file @
5d26bb3e
...
...
@@ -920,20 +920,24 @@ pyfileh_open(PyObject *pyfile0, PyObject *args)
RAM
*
ram
=
ram_get_default
(
NULL
);
// TODO get ram from args
int
err
;
if
(
!
PyArg_ParseTuple
(
args
,
"
"
))
// XXX parse mmap_overlay=None (True/False
)
int
mmap_overlay
=
-
1
;
/* -1 means None; https://bugs.python.org/issue14705 */
if
(
!
PyArg_ParseTuple
(
args
,
"
|i"
,
&
mmap_overlay
)
)
return
NULL
;
// XXX verify if pyfile has .mmapper()
// if mmap_overlay or (mmap_overlay==None and has(pyfile.mmapper)):
// mmaper = pyfile.mmapper()
if
(
mmap_overlay
==
-
1
)
mmap_overlay
=
(
pyfile
->
blkmmap_ops
!=
NULL
?
1
:
0
);
if
(
mmap_overlay
&&
pyfile
->
blkmmap_ops
==
NULL
)
{
PyErr_SetString
(
PyExc_TypeError
,
"BigFile subtype does not provide blkmmapper"
);
return
NULL
;
}
pyfileh
=
PyType_New
(
PyBigFileH
,
&
PyBigFileH_Type
,
NULL
);
if
(
!
pyfileh
)
return
NULL
;
Py_INCREF
(
pyfile
);
err
=
fileh_open
(
&
pyfileh
->
fileh
,
&
pyfile
->
file
,
ram
,
DONT_MMAP_OVERLAY
);
// XXX -> MMAP_OVERLAY if requested
err
=
fileh_open
(
&
pyfileh
->
fileh
,
&
pyfile
->
file
,
ram
,
mmap_overlay
?
MMAP_OVERLAY
:
DONT_MMAP_OVERLAY
);
if
(
err
)
{
XPyErr_SetFromErrno
();
Py_DECREF
(
pyfile
);
...
...
bigfile/_bigfile.h
View file @
5d26bb3e
...
...
@@ -110,6 +110,11 @@ struct PyBigFile {
* automatically adds support for weakrefs for in-python defined children */
BigFile
file
;
/* PyCapsule object with blkmmapper if BigFile subclass has it | NULL */
PyObject
*
blkmmapper_pycapsule
;
// XXX traverse for GC?
/* bigfile_ops extract from ^^^ capsule | NULL */
bigfile_ops
*
blkmmap_ops
;
};
typedef
struct
PyBigFile
PyBigFile
;
...
...
bigfile/_file_zodb.pyx
View file @
5d26bb3e
...
...
@@ -24,6 +24,8 @@
"""XXX"""
from
__future__
import
print_function
,
absolute_import
cdef
extern
from
"wcfs/internal/wcfs.h"
:
pass
...
...
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