[Zope-Checkins] CVS: Zope3/lib/python/Persistence/BTrees - BTreeTemplate.c:1.1.2.22 BucketTemplate.c:1.1.2.21
Tim Peters
tim.one@comcast.net
Fri, 7 Jun 2002 01:57:24 -0400
Update of /cvs-repository/Zope3/lib/python/Persistence/BTrees
In directory cvs.zope.org:/tmp/cvs-serv2538
Modified Files:
Tag: Zope-3x-branch
BTreeTemplate.c BucketTemplate.c
Log Message:
Just added comments to the traverse methods, to explain why they get
out early sometimes.
=== Zope3/lib/python/Persistence/BTrees/BTreeTemplate.c 1.1.2.21 => 1.1.2.22 ===
{
if (self->po_state == UPTODATE && self->po_dm) {
- if (_BTree_clear(self) < 0)
+ if (_BTree_clear(self) < 0)
return NULL;
self->po_state = GHOST;
}
@@ -1273,7 +1273,7 @@
{
int err = 0;
int i, len;
-
+
#define VISIT(SLOT) \
if (SLOT) { \
err = visit((PyObject *)(SLOT), arg); \
@@ -1287,6 +1287,10 @@
if (err)
goto Done;
+ /* If this is registered with the persistence system, cleaning up cycles
+ * 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);
=== Zope3/lib/python/Persistence/BTrees/BucketTemplate.c 1.1.2.20 => 1.1.2.21 ===
PyObject_ClearWeakRefs((PyObject *)self);
PyPersist_BASE_TYPE->tp_dealloc((PyObject *)self);
- if (self->po_state != GHOST)
+ if (self->po_state != GHOST)
_bucket_clear(self);
}
@@ -1202,6 +1202,10 @@
if (err)
goto Done;
+ /* If this is registered with the persistence system, cleaning up cycles
+ * 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)
goto Done;
assert(self->po_state != GHOST);