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
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
ZEO
Commits
a0a80adf
Commit
a0a80adf
authored
Apr 03, 2002
by
Toby Dickenson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replaced placeholder; its needed to avoid dangling pointers
parent
9481135a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
24 deletions
+54
-24
src/Persistence/cPickleCache.c
src/Persistence/cPickleCache.c
+18
-8
src/ZODB/cPickleCache.c
src/ZODB/cPickleCache.c
+18
-8
src/persistent/cPickleCache.c
src/persistent/cPickleCache.c
+18
-8
No files found.
src/Persistence/cPickleCache.c
View file @
a0a80adf
...
...
@@ -90,7 +90,7 @@ them.
static
char
cPickleCache_doc_string
[]
=
"Defines the PickleCache used by ZODB Connection objects.
\n
"
"
\n
"
"$Id: cPickleCache.c,v 1.5
1 2002/04/03 17:00:44
htrd Exp $
\n
"
;
"$Id: cPickleCache.c,v 1.5
2 2002/04/03 17:20:33
htrd Exp $
\n
"
;
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E))
...
...
@@ -220,6 +220,7 @@ scan_gc_items(ccobject *self,int target)
cPersistentObject
*
object
;
int
error
;
CPersistentRing
placeholder
;
CPersistentRing
*
here
=
self
->
ring_home
.
next
;
#ifdef MUCH_RING_CHECKING
...
...
@@ -278,13 +279,17 @@ scan_gc_items(ccobject *self,int target)
else
if
(
object
->
state
==
cPersistent_UPTODATE_STATE
)
{
/* deactivate it. This is the main memory saver. */
/* Save the next pointer of the object we're about to ghostify,
* so that we can follow the link after the ghosted object is
* removed from the ring (via ghostify()).
*/
/* Add a placeholder; a dummy node in the ring. We need to
do this to mark our position in the ring. All the other nodes
come from persistent objects, and they are all liable
to be deallocated before "obj._p_changed = None" returns
to this function. This operation is only safe when the
ring lock is held (and it is) */
/* FIXME: This needs to be changed back to a placeholder */
CPersistentRing
*
next
=
here
->
next
;
placeholder
.
next
=
here
->
next
;
placeholder
.
prev
=
here
;
here
->
next
->
prev
=
&
placeholder
;
here
->
next
=
&
placeholder
;
ENGINE_NOISE
(
"G"
);
...
...
@@ -292,7 +297,12 @@ scan_gc_items(ccobject *self,int target)
error
=
PyObject_SetAttr
((
PyObject
*
)
object
,
py__p_changed
,
Py_None
);
here
=
next
;
/* unlink the placeholder */
placeholder
.
next
->
prev
=
placeholder
.
prev
;
placeholder
.
prev
->
next
=
placeholder
.
next
;
here
=
placeholder
.
next
;
if
(
error
)
return
-
1
;
/* problem */
...
...
src/ZODB/cPickleCache.c
View file @
a0a80adf
...
...
@@ -90,7 +90,7 @@ them.
static
char
cPickleCache_doc_string
[]
=
"Defines the PickleCache used by ZODB Connection objects.
\n
"
"
\n
"
"$Id: cPickleCache.c,v 1.5
1 2002/04/03 17:00:44
htrd Exp $
\n
"
;
"$Id: cPickleCache.c,v 1.5
2 2002/04/03 17:20:33
htrd Exp $
\n
"
;
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E))
...
...
@@ -220,6 +220,7 @@ scan_gc_items(ccobject *self,int target)
cPersistentObject
*
object
;
int
error
;
CPersistentRing
placeholder
;
CPersistentRing
*
here
=
self
->
ring_home
.
next
;
#ifdef MUCH_RING_CHECKING
...
...
@@ -278,13 +279,17 @@ scan_gc_items(ccobject *self,int target)
else
if
(
object
->
state
==
cPersistent_UPTODATE_STATE
)
{
/* deactivate it. This is the main memory saver. */
/* Save the next pointer of the object we're about to ghostify,
* so that we can follow the link after the ghosted object is
* removed from the ring (via ghostify()).
*/
/* Add a placeholder; a dummy node in the ring. We need to
do this to mark our position in the ring. All the other nodes
come from persistent objects, and they are all liable
to be deallocated before "obj._p_changed = None" returns
to this function. This operation is only safe when the
ring lock is held (and it is) */
/* FIXME: This needs to be changed back to a placeholder */
CPersistentRing
*
next
=
here
->
next
;
placeholder
.
next
=
here
->
next
;
placeholder
.
prev
=
here
;
here
->
next
->
prev
=
&
placeholder
;
here
->
next
=
&
placeholder
;
ENGINE_NOISE
(
"G"
);
...
...
@@ -292,7 +297,12 @@ scan_gc_items(ccobject *self,int target)
error
=
PyObject_SetAttr
((
PyObject
*
)
object
,
py__p_changed
,
Py_None
);
here
=
next
;
/* unlink the placeholder */
placeholder
.
next
->
prev
=
placeholder
.
prev
;
placeholder
.
prev
->
next
=
placeholder
.
next
;
here
=
placeholder
.
next
;
if
(
error
)
return
-
1
;
/* problem */
...
...
src/persistent/cPickleCache.c
View file @
a0a80adf
...
...
@@ -90,7 +90,7 @@ them.
static
char
cPickleCache_doc_string
[]
=
"Defines the PickleCache used by ZODB Connection objects.
\n
"
"
\n
"
"$Id: cPickleCache.c,v 1.5
1 2002/04/03 17:00:44
htrd Exp $
\n
"
;
"$Id: cPickleCache.c,v 1.5
2 2002/04/03 17:20:33
htrd Exp $
\n
"
;
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E))
...
...
@@ -220,6 +220,7 @@ scan_gc_items(ccobject *self,int target)
cPersistentObject
*
object
;
int
error
;
CPersistentRing
placeholder
;
CPersistentRing
*
here
=
self
->
ring_home
.
next
;
#ifdef MUCH_RING_CHECKING
...
...
@@ -278,13 +279,17 @@ scan_gc_items(ccobject *self,int target)
else
if
(
object
->
state
==
cPersistent_UPTODATE_STATE
)
{
/* deactivate it. This is the main memory saver. */
/* Save the next pointer of the object we're about to ghostify,
* so that we can follow the link after the ghosted object is
* removed from the ring (via ghostify()).
*/
/* Add a placeholder; a dummy node in the ring. We need to
do this to mark our position in the ring. All the other nodes
come from persistent objects, and they are all liable
to be deallocated before "obj._p_changed = None" returns
to this function. This operation is only safe when the
ring lock is held (and it is) */
/* FIXME: This needs to be changed back to a placeholder */
CPersistentRing
*
next
=
here
->
next
;
placeholder
.
next
=
here
->
next
;
placeholder
.
prev
=
here
;
here
->
next
->
prev
=
&
placeholder
;
here
->
next
=
&
placeholder
;
ENGINE_NOISE
(
"G"
);
...
...
@@ -292,7 +297,12 @@ scan_gc_items(ccobject *self,int target)
error
=
PyObject_SetAttr
((
PyObject
*
)
object
,
py__p_changed
,
Py_None
);
here
=
next
;
/* unlink the placeholder */
placeholder
.
next
->
prev
=
placeholder
.
prev
;
placeholder
.
prev
->
next
=
placeholder
.
next
;
here
=
placeholder
.
next
;
if
(
error
)
return
-
1
;
/* problem */
...
...
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