Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
5c9e1624
Commit
5c9e1624
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
084b834d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
24 deletions
+54
-24
trunk/src/Persistence/cPickleCache.c
trunk/src/Persistence/cPickleCache.c
+18
-8
trunk/src/ZODB/cPickleCache.c
trunk/src/ZODB/cPickleCache.c
+18
-8
trunk/src/persistent/cPickleCache.c
trunk/src/persistent/cPickleCache.c
+18
-8
No files found.
trunk/src/Persistence/cPickleCache.c
View file @
5c9e1624
...
...
@@ -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 */
...
...
trunk/src/ZODB/cPickleCache.c
View file @
5c9e1624
...
...
@@ -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 */
...
...
trunk/src/persistent/cPickleCache.c
View file @
5c9e1624
...
...
@@ -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