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
e62653d7
Commit
e62653d7
authored
Dec 18, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
56a76f96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
bigfile/_bigfile.c
bigfile/_bigfile.c
+12
-12
No files found.
bigfile/_bigfile.c
View file @
e62653d7
...
...
@@ -113,7 +113,7 @@ static Py_ssize_t
pyvma_getbuf
(
PyObject
*
pyvma0
,
Py_ssize_t
segment
,
void
**
pptr
)
{
PyVMA
*
pyvma
=
container_of
(
pyvma0
,
PyVMA
,
pyobj
);
VMA
*
vma
=
&
pyvma
->
vma
;
VMA
*
vma
=
&
pyvma
->
vma
;
if
(
segment
)
{
PyErr_SetString
(
PyExc_SystemError
,
"access to non-zero vma segment"
);
...
...
@@ -129,7 +129,7 @@ static Py_ssize_t
pyvma_getsegcount
(
PyObject
*
pyvma0
,
Py_ssize_t
*
lenp
)
{
PyVMA
*
pyvma
=
container_of
(
pyvma0
,
PyVMA
,
pyobj
);
VMA
*
vma
=
&
pyvma
->
vma
;
VMA
*
vma
=
&
pyvma
->
vma
;
if
(
lenp
)
*
lenp
=
vma
->
addr_stop
-
vma
->
addr_start
;
...
...
@@ -142,7 +142,7 @@ static int
pyvma_getbuffer
(
PyObject
*
pyvma0
,
Py_buffer
*
view
,
int
flags
)
{
PyVMA
*
pyvma
=
container_of
(
pyvma0
,
PyVMA
,
pyobj
);
VMA
*
vma
=
&
pyvma
->
vma
;
VMA
*
vma
=
&
pyvma
->
vma
;
return
PyBuffer_FillInfo
(
view
,
&
pyvma
->
pyobj
,
(
void
*
)
vma
->
addr_start
,
vma
->
addr_stop
-
vma
->
addr_start
,
...
...
@@ -155,7 +155,7 @@ static Py_ssize_t
pyvma_len
(
PyObject
*
pyvma0
)
{
PyVMA
*
pyvma
=
container_of
(
pyvma0
,
PyVMA
,
pyobj
);
VMA
*
vma
=
&
pyvma
->
vma
;
VMA
*
vma
=
&
pyvma
->
vma
;
return
vma
->
addr_stop
-
vma
->
addr_start
;
}
...
...
@@ -185,7 +185,7 @@ PyFunc(pyvma_filerange, "filerange() -> (pgoffset, pglen) -- file range this vma
(
PyObject
*
pyvma0
,
PyObject
*
args
)
{
PyVMA
*
pyvma
=
container_of
(
pyvma0
,
PyVMA
,
pyobj
);
VMA
*
vma
=
&
pyvma
->
vma
;
VMA
*
vma
=
&
pyvma
->
vma
;
Py_ssize_t
pgoffset
,
pglen
;
// XXX Py_ssize_t vs pgoff_t
pgoffset
=
vma
->
f_pgoffset
;
...
...
@@ -200,7 +200,7 @@ PyFunc(pyvma_pagesize, "pagesize() -> pagesize -- page size of RAM underlying th
(
PyObject
*
pyvma0
,
PyObject
*
args
)
{
PyVMA
*
pyvma
=
container_of
(
pyvma0
,
PyVMA
,
pyobj
);
VMA
*
vma
=
&
pyvma
->
vma
;
VMA
*
vma
=
&
pyvma
->
vma
;
Py_ssize_t
pagesize
=
vma
->
fileh
->
ramh
->
ram
->
pagesize
;
return
Py_BuildValue
(
"n"
,
pagesize
);
...
...
@@ -286,7 +286,7 @@ static /*const*/ PyMemberDef pyvma_members[] = {
{
"addr_start"
,
T_UINTPTR
,
offsetof
(
PyVMA
,
vma
.
addr_start
),
READONLY
,
"vma's start addr"
},
{
"addr_stop"
,
T_UINTPTR
,
offsetof
(
PyVMA
,
vma
.
addr_stop
),
READONLY
,
"vma's start addr"
},
// XXX pyuser: restrict to read-only access?
{
"pyuser"
,
T_OBJECT_EX
,
offsetof
(
PyVMA
,
pyuser
),
0
,
"user of this vma"
},
{
"pyuser"
,
T_OBJECT_EX
,
offsetof
(
PyVMA
,
pyuser
),
0
,
"user of this vma"
},
{
NULL
}
};
...
...
@@ -347,7 +347,7 @@ PyFunc(pyfileh_dirty_writeout,
(
PyObject
*
pyfileh0
,
PyObject
*
args
)
{
PyBigFileH
*
pyfileh
=
container_of
(
pyfileh0
,
PyBigFileH
,
pyobj
);
BigFileH
*
fileh
=
&
pyfileh
->
fileh
;
BigFileH
*
fileh
=
&
pyfileh
->
fileh
;
long
flags
;
int
err
;
...
...
@@ -370,7 +370,7 @@ PyFunc(pyfileh_dirty_discard, "dirty_discard() - discard changes made to fileh m
(
PyObject
*
pyfileh0
,
PyObject
*
args
)
{
PyBigFileH
*
pyfileh
=
container_of
(
pyfileh0
,
PyBigFileH
,
pyobj
);
BigFileH
*
fileh
=
&
pyfileh
->
fileh
;
BigFileH
*
fileh
=
&
pyfileh
->
fileh
;
if
(
!
PyArg_ParseTuple
(
args
,
""
))
return
NULL
;
...
...
@@ -384,7 +384,7 @@ PyFunc(pyfileh_isdirty, "isdirty() - are there any changes to fileh memory at al
(
PyObject
*
pyfileh0
,
PyObject
*
args
)
{
PyBigFileH
*
pyfileh
=
container_of
(
pyfileh0
,
PyBigFileH
,
pyobj
);
BigFileH
*
fileh
=
&
pyfileh
->
fileh
;
BigFileH
*
fileh
=
&
pyfileh
->
fileh
;
if
(
!
PyArg_ParseTuple
(
args
,
""
))
return
NULL
;
...
...
@@ -416,8 +416,8 @@ pyfileh_dealloc(PyObject *pyfileh0)
/* PyBigFileH does not support cyclic GC - no need to PyObject_GC_UnTrack it */
PyBigFileH
*
pyfileh
=
container_of
(
pyfileh0
,
PyBigFileH
,
pyobj
);
BigFileH
*
fileh
=
&
pyfileh
->
fileh
;
BigFile
*
file
=
fileh
->
file
;
BigFileH
*
fileh
=
&
pyfileh
->
fileh
;
BigFile
*
file
=
fileh
->
file
;
PyBigFile
*
pyfile
;
if
(
pyfileh
->
in_weakreflist
)
...
...
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