Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
persistent
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
Kirill Smelkov
persistent
Commits
33daf912
Commit
33daf912
authored
Mar 24, 2014
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Py_ssize_t rather than PY_LONG_LONG for sizes.
parent
9cbb3ea3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
persistent/cPersistence.h
persistent/cPersistence.h
+1
-1
persistent/cPickleCache.c
persistent/cPickleCache.c
+9
-9
No files found.
persistent/cPersistence.h
View file @
33daf912
...
...
@@ -24,7 +24,7 @@
PyObject_HEAD \
CPersistentRing ring_home; \
int non_ghost_count; \
P
Y_LONG_LONG
total_estimated_size;
P
y_ssize_t
total_estimated_size;
struct
ccobject_head_struct
;
...
...
persistent/cPickleCache.c
View file @
33daf912
...
...
@@ -123,7 +123,7 @@ typedef struct
PyObject
*
data
;
/* oid -> object dict */
PyObject
*
jar
;
/* Connection object */
int
cache_size
;
/* target number of items in cache */
P
Y_LONG_LONG
cache_size_bytes
;
/* target total estimated size of
P
y_ssize_t
cache_size_bytes
;
/* target total estimated size of
items in cache */
/* Most of the time the ring contains only:
...
...
@@ -176,7 +176,7 @@ unlink_from_ring(CPersistentRing *self)
}
static
int
scan_gc_items
(
ccobject
*
self
,
int
target
,
P
Y_LONG_LONG
target_bytes
)
scan_gc_items
(
ccobject
*
self
,
int
target
,
P
y_ssize_t
target_bytes
)
{
/* This function must only be called with the ring lock held,
because it places non-object placeholders in the ring.
...
...
@@ -262,7 +262,7 @@ Done:
}
static
PyObject
*
lockgc
(
ccobject
*
self
,
int
target_size
,
P
Y_LONG_LONG
target_size_bytes
)
lockgc
(
ccobject
*
self
,
int
target_size
,
P
y_ssize_t
target_size_bytes
)
{
/* This is thread-safe because of the GIL, and there's nothing
* in between checking the ring_lock and acquiring it that calls back
...
...
@@ -292,7 +292,7 @@ cc_incrgc(ccobject *self, PyObject *args)
int
obsolete_arg
=
-
999
;
int
starting_size
=
self
->
non_ghost_count
;
int
target_size
=
self
->
cache_size
;
P
Y_LONG_LONG
target_size_bytes
=
self
->
cache_size_bytes
;
P
y_ssize_t
target_size_bytes
=
self
->
cache_size_bytes
;
if
(
self
->
cache_drain_resistance
>=
1
)
{
...
...
@@ -850,10 +850,10 @@ static int
cc_init
(
ccobject
*
self
,
PyObject
*
args
,
PyObject
*
kwds
)
{
int
cache_size
=
100
;
P
Y_LONG_LONG
cache_size_bytes
=
0
;
P
y_ssize_t
cache_size_bytes
=
0
;
PyObject
*
jar
;
if
(
!
PyArg_ParseTuple
(
args
,
"O|i
L
"
,
&
jar
,
&
cache_size
,
&
cache_size_bytes
))
if
(
!
PyArg_ParseTuple
(
args
,
"O|i
n
"
,
&
jar
,
&
cache_size
,
&
cache_size_bytes
))
return
-
1
;
self
->
jar
=
NULL
;
...
...
@@ -1245,9 +1245,9 @@ static PyGetSetDef cc_getsets[] =
static
PyMemberDef
cc_members
[]
=
{
{
"cache_size"
,
T_INT
,
offsetof
(
ccobject
,
cache_size
)},
{
"cache_size_bytes"
,
T_
LONG
,
offsetof
(
ccobject
,
cache_size_bytes
)},
{
"total_estimated_size"
,
T_
LONG
,
offsetof
(
ccobject
,
total_estimated_size
)
,
READONLY
},
{
"cache_size_bytes"
,
T_
PYSSIZET
,
offsetof
(
ccobject
,
cache_size_bytes
)},
{
"total_estimated_size"
,
T_
PYSSIZET
,
offsetof
(
ccobject
,
total_estimated_size
),
READONLY
},
{
"cache_drain_resistance"
,
T_INT
,
offsetof
(
ccobject
,
cache_drain_resistance
)},
{
"cache_non_ghost_count"
,
T_INT
,
offsetof
(
ccobject
,
non_ghost_count
),
...
...
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