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
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)
...
@@ -920,20 +920,24 @@ pyfileh_open(PyObject *pyfile0, PyObject *args)
RAM
*
ram
=
ram_get_default
(
NULL
);
// TODO get ram from args
RAM
*
ram
=
ram_get_default
(
NULL
);
// TODO get ram from args
int
err
;
int
err
;
int
mmap_overlay
=
-
1
;
/* -1 means None; https://bugs.python.org/issue14705 */
if
(
!
PyArg_ParseTuple
(
args
,
"
"
))
// XXX parse mmap_overlay=None (True/False
)
if
(
!
PyArg_ParseTuple
(
args
,
"
|i"
,
&
mmap_overlay
)
)
return
NULL
;
return
NULL
;
// XXX verify if pyfile has .mmapper()
if
(
mmap_overlay
==
-
1
)
// if mmap_overlay or (mmap_overlay==None and has(pyfile.mmapper)):
mmap_overlay
=
(
pyfile
->
blkmmap_ops
!=
NULL
?
1
:
0
);
// mmaper = pyfile.mmapper()
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
);
pyfileh
=
PyType_New
(
PyBigFileH
,
&
PyBigFileH_Type
,
NULL
);
if
(
!
pyfileh
)
if
(
!
pyfileh
)
return
NULL
;
return
NULL
;
Py_INCREF
(
pyfile
);
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
)
{
if
(
err
)
{
XPyErr_SetFromErrno
();
XPyErr_SetFromErrno
();
Py_DECREF
(
pyfile
);
Py_DECREF
(
pyfile
);
...
...
bigfile/_bigfile.h
View file @
5d26bb3e
...
@@ -110,6 +110,11 @@ struct PyBigFile {
...
@@ -110,6 +110,11 @@ struct PyBigFile {
* automatically adds support for weakrefs for in-python defined children */
* automatically adds support for weakrefs for in-python defined children */
BigFile
file
;
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
;
typedef
struct
PyBigFile
PyBigFile
;
...
...
bigfile/_file_zodb.pyx
View file @
5d26bb3e
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
"""XXX"""
"""XXX"""
from
__future__
import
print_function
,
absolute_import
cdef
extern
from
"wcfs/internal/wcfs.h"
:
cdef
extern
from
"wcfs/internal/wcfs.h"
:
pass
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