[Zodb-checkins] CVS: Zope3/src/zodb/btrees - BTreeTemplate.c:1.12 BucketTemplate.c:1.12

Jeremy Hylton jeremy@zope.com
Thu, 3 Apr 2003 18:39:08 -0500


Update of /cvs-repository/Zope3/src/zodb/btrees
In directory cvs.zope.org:/tmp/cvs-serv23590/btrees

Modified Files:
	BTreeTemplate.c BucketTemplate.c 
Log Message:
Change gc logic for BTrees and Buckets.

If the object is a ghost, don't unghostify it or access any of the
data.  But if the object is not a ghost and is registered with the
database, it's still useful to let Python's GC visit this object.  The
object may be involved in a collectible cycle.


=== Zope3/src/zodb/btrees/BTreeTemplate.c 1.11 => 1.12 ===
--- Zope3/src/zodb/btrees/BTreeTemplate.c:1.11	Tue Mar 18 17:30:45 2003
+++ Zope3/src/zodb/btrees/BTreeTemplate.c	Thu Apr  3 18:39:07 2003
@@ -1920,9 +1920,8 @@
      * is the database's problem.  It would be horrid to unghostify BTree
      * nodes here just to chase pointers every time gc runs.
      */
-    if (self->po_oid != NULL)
-        goto Done;
-    assert(self->po_state != GHOST);
+    if (self->po_state == GHOST)
+	goto Done;
 
     len = self->len;
 #ifdef KEY_TYPE_IS_PYOBJECT


=== Zope3/src/zodb/btrees/BucketTemplate.c 1.11 => 1.12 ===
--- Zope3/src/zodb/btrees/BucketTemplate.c:1.11	Tue Mar  4 17:36:53 2003
+++ Zope3/src/zodb/btrees/BucketTemplate.c	Thu Apr  3 18:39:07 2003
@@ -1522,9 +1522,8 @@
      * is the database's problem.  It would be horrid to unghostify buckets
      * here just to chase pointers every time gc runs.
      */
-    if (self->po_oid != NULL)
+    if (self->po_state == GHOST);
         goto Done;
-    assert(self->po_state != GHOST);
 
     len = self->len;
     (void)i;    /* if neither keys nor values are PyObject*, "i" is otherwise