Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
2ac3cd1f
Commit
2ac3cd1f
authored
Jul 06, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added logic to call the connection setklassstate when invalidating a klass.
parent
bd60b6b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
15 deletions
+66
-15
src/Persistence/cPickleCache.c
src/Persistence/cPickleCache.c
+22
-5
src/ZODB/cPickleCache.c
src/ZODB/cPickleCache.c
+22
-5
src/persistent/cPickleCache.c
src/persistent/cPickleCache.c
+22
-5
No files found.
src/Persistence/cPickleCache.c
View file @
2ac3cd1f
...
...
@@ -82,7 +82,7 @@
attributions are listed in the accompanying credits file.
****************************************************************************/
static
char
*
what_string
=
"$Id: cPickleCache.c,v 1.2
5 1999/06/29 21:52:58
jim Exp $"
;
static
char
*
what_string
=
"$Id: cPickleCache.c,v 1.2
6 1999/07/06 19:24:22
jim Exp $"
;
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E))
...
...
@@ -100,6 +100,7 @@ typedef struct {
PyObject_HEAD
PyObject
*
data
;
PyObject
*
jar
;
PyObject
*
setklassstate
;
int
position
;
int
cache_size
;
int
cache_age
;
...
...
@@ -346,9 +347,21 @@ _invalidate(ccobject *self, PyObject *key)
if
((
v
=
PyDict_GetItem
(
self
->
data
,
key
)))
{
if
((
!
PyExtensionClass_Check
(
v
))
&&
PyObject_DelAttr
(
v
,
py__p_changed
)
<
0
)
if
(
PyExtensionClass_Check
(
v
))
if
(
v
->
ob_refcnt
<=
1
)
{
self
->
sum_deal
++
;
if
(
PyDict_DelItem
(
self
->
data
,
key
)
<
0
)
PyErr_Clear
();
}
else
{
v
=
PyObject_CallFunction
(
self
->
setklassstate
,
"O"
,
v
);
if
(
v
)
Py_DECREF
(
v
);
else
PyErr_Clear
();
}
else
if
(
PyObject_DelAttr
(
v
,
py__p_changed
)
<
0
)
PyErr_Clear
();
}
else
PyErr_Clear
();
...
...
@@ -457,10 +470,13 @@ newccobject(PyObject *jar, int cache_size, int cache_age)
ccobject
*
self
;
UNLESS
(
self
=
PyObject_NEW
(
ccobject
,
&
Cctype
))
return
NULL
;
self
->
setklassstate
=
self
->
jar
=
NULL
;
if
(
self
->
data
=
PyDict_New
())
{
self
->
jar
=
jar
;
Py_INCREF
(
jar
);
UNLESS
(
self
->
setklassstate
=
PyObject_GetAttrString
(
jar
,
"setklassstate"
))
return
NULL
;
self
->
position
=
0
;
self
->
cache_size
=
cache_size
;
self
->
cache_age
=
cache_age
<
1
?
1
:
cache_age
;
...
...
@@ -486,6 +502,7 @@ cc_dealloc(ccobject *self)
{
Py_XDECREF
(
self
->
data
);
Py_XDECREF
(
self
->
jar
);
Py_XDECREF
(
self
->
setklassstate
);
PyMem_DEL
(
self
);
}
...
...
@@ -652,7 +669,7 @@ void
initcPickleCache
()
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.2
5
$"
;
char
*
rev
=
"$Revision: 1.2
6
$"
;
Cctype
.
ob_type
=&
PyType_Type
;
...
...
src/ZODB/cPickleCache.c
View file @
2ac3cd1f
...
...
@@ -82,7 +82,7 @@
attributions are listed in the accompanying credits file.
****************************************************************************/
static
char
*
what_string
=
"$Id: cPickleCache.c,v 1.2
5 1999/06/29 21:52:58
jim Exp $"
;
static
char
*
what_string
=
"$Id: cPickleCache.c,v 1.2
6 1999/07/06 19:24:22
jim Exp $"
;
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E))
...
...
@@ -100,6 +100,7 @@ typedef struct {
PyObject_HEAD
PyObject
*
data
;
PyObject
*
jar
;
PyObject
*
setklassstate
;
int
position
;
int
cache_size
;
int
cache_age
;
...
...
@@ -346,9 +347,21 @@ _invalidate(ccobject *self, PyObject *key)
if
((
v
=
PyDict_GetItem
(
self
->
data
,
key
)))
{
if
((
!
PyExtensionClass_Check
(
v
))
&&
PyObject_DelAttr
(
v
,
py__p_changed
)
<
0
)
if
(
PyExtensionClass_Check
(
v
))
if
(
v
->
ob_refcnt
<=
1
)
{
self
->
sum_deal
++
;
if
(
PyDict_DelItem
(
self
->
data
,
key
)
<
0
)
PyErr_Clear
();
}
else
{
v
=
PyObject_CallFunction
(
self
->
setklassstate
,
"O"
,
v
);
if
(
v
)
Py_DECREF
(
v
);
else
PyErr_Clear
();
}
else
if
(
PyObject_DelAttr
(
v
,
py__p_changed
)
<
0
)
PyErr_Clear
();
}
else
PyErr_Clear
();
...
...
@@ -457,10 +470,13 @@ newccobject(PyObject *jar, int cache_size, int cache_age)
ccobject
*
self
;
UNLESS
(
self
=
PyObject_NEW
(
ccobject
,
&
Cctype
))
return
NULL
;
self
->
setklassstate
=
self
->
jar
=
NULL
;
if
(
self
->
data
=
PyDict_New
())
{
self
->
jar
=
jar
;
Py_INCREF
(
jar
);
UNLESS
(
self
->
setklassstate
=
PyObject_GetAttrString
(
jar
,
"setklassstate"
))
return
NULL
;
self
->
position
=
0
;
self
->
cache_size
=
cache_size
;
self
->
cache_age
=
cache_age
<
1
?
1
:
cache_age
;
...
...
@@ -486,6 +502,7 @@ cc_dealloc(ccobject *self)
{
Py_XDECREF
(
self
->
data
);
Py_XDECREF
(
self
->
jar
);
Py_XDECREF
(
self
->
setklassstate
);
PyMem_DEL
(
self
);
}
...
...
@@ -652,7 +669,7 @@ void
initcPickleCache
()
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.2
5
$"
;
char
*
rev
=
"$Revision: 1.2
6
$"
;
Cctype
.
ob_type
=&
PyType_Type
;
...
...
src/persistent/cPickleCache.c
View file @
2ac3cd1f
...
...
@@ -82,7 +82,7 @@
attributions are listed in the accompanying credits file.
****************************************************************************/
static
char
*
what_string
=
"$Id: cPickleCache.c,v 1.2
5 1999/06/29 21:52:58
jim Exp $"
;
static
char
*
what_string
=
"$Id: cPickleCache.c,v 1.2
6 1999/07/06 19:24:22
jim Exp $"
;
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E))
...
...
@@ -100,6 +100,7 @@ typedef struct {
PyObject_HEAD
PyObject
*
data
;
PyObject
*
jar
;
PyObject
*
setklassstate
;
int
position
;
int
cache_size
;
int
cache_age
;
...
...
@@ -346,9 +347,21 @@ _invalidate(ccobject *self, PyObject *key)
if
((
v
=
PyDict_GetItem
(
self
->
data
,
key
)))
{
if
((
!
PyExtensionClass_Check
(
v
))
&&
PyObject_DelAttr
(
v
,
py__p_changed
)
<
0
)
if
(
PyExtensionClass_Check
(
v
))
if
(
v
->
ob_refcnt
<=
1
)
{
self
->
sum_deal
++
;
if
(
PyDict_DelItem
(
self
->
data
,
key
)
<
0
)
PyErr_Clear
();
}
else
{
v
=
PyObject_CallFunction
(
self
->
setklassstate
,
"O"
,
v
);
if
(
v
)
Py_DECREF
(
v
);
else
PyErr_Clear
();
}
else
if
(
PyObject_DelAttr
(
v
,
py__p_changed
)
<
0
)
PyErr_Clear
();
}
else
PyErr_Clear
();
...
...
@@ -457,10 +470,13 @@ newccobject(PyObject *jar, int cache_size, int cache_age)
ccobject
*
self
;
UNLESS
(
self
=
PyObject_NEW
(
ccobject
,
&
Cctype
))
return
NULL
;
self
->
setklassstate
=
self
->
jar
=
NULL
;
if
(
self
->
data
=
PyDict_New
())
{
self
->
jar
=
jar
;
Py_INCREF
(
jar
);
UNLESS
(
self
->
setklassstate
=
PyObject_GetAttrString
(
jar
,
"setklassstate"
))
return
NULL
;
self
->
position
=
0
;
self
->
cache_size
=
cache_size
;
self
->
cache_age
=
cache_age
<
1
?
1
:
cache_age
;
...
...
@@ -486,6 +502,7 @@ cc_dealloc(ccobject *self)
{
Py_XDECREF
(
self
->
data
);
Py_XDECREF
(
self
->
jar
);
Py_XDECREF
(
self
->
setklassstate
);
PyMem_DEL
(
self
);
}
...
...
@@ -652,7 +669,7 @@ void
initcPickleCache
()
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.2
5
$"
;
char
*
rev
=
"$Revision: 1.2
6
$"
;
Cctype
.
ob_type
=&
PyType_Type
;
...
...
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