[Zodb-checkins] CVS: ZODB3/BTrees - BTreeTemplate.c:1.74.10.8
BucketTemplate.c:1.54.6.7
Jeremy Hylton
jeremy at zope.com
Thu Jul 10 12:42:45 EDT 2003
Update of /cvs-repository/ZODB3/BTrees
In directory cvs.zope.org:/tmp/cvs-serv7499/BTrees
Modified Files:
Tag: zodb33-devel-branch
BTreeTemplate.c BucketTemplate.c
Log Message:
Call supertype directly, since we can't be sure what tp_base is.
=== ZODB3/BTrees/BTreeTemplate.c 1.74.10.7 => 1.74.10.8 ===
--- ZODB3/BTrees/BTreeTemplate.c:1.74.10.7 Thu Jul 10 10:54:42 2003
+++ ZODB3/BTrees/BTreeTemplate.c Thu Jul 10 11:42:37 2003
@@ -1898,7 +1898,7 @@
{
if (self->state != cPersistent_GHOST_STATE)
_BTree_clear(self);
- self->ob_type->tp_base->tp_dealloc((PyObject *)self);
+ cPersistenceCAPI->pertype->tp_dealloc((PyObject *)self);
}
static int
@@ -1920,8 +1920,7 @@
/* Call our base type's traverse function. Because BTrees are
* subclasses of Peristent, there must be one.
*/
- assert(self->ob_type->tp_base->tp_traverse);
- err = self->ob_type->tp_base->tp_traverse((PyObject *)self, visit, arg);
+ err = cPersistenceCAPI->pertype->tp_traverse((PyObject *)self, visit, arg);
if (err)
goto Done;
@@ -1956,13 +1955,9 @@
static int
BTree_tp_clear(BTree *self)
{
- /* Call our base type's clear function, if any. */
- if (self->ob_type->tp_base->tp_clear)
- self->ob_type->tp_base->tp_clear((PyObject *)self);
-
if (self->state != cPersistent_GHOST_STATE)
_BTree_clear(self);
- return 0;
+ return cPersistenceCAPI->pertype->tp_clear((PyObject *)self);
}
/*
=== ZODB3/BTrees/BucketTemplate.c 1.54.6.6 => 1.54.6.7 ===
--- ZODB3/BTrees/BucketTemplate.c:1.54.6.6 Thu Jul 10 10:54:42 2003
+++ ZODB3/BTrees/BucketTemplate.c Thu Jul 10 11:42:37 2003
@@ -1508,7 +1508,8 @@
{
if (self->state != cPersistent_GHOST_STATE)
_bucket_clear(self);
- self->ob_type->tp_base->tp_dealloc((PyObject *)self);
+
+ cPersistenceCAPI->pertype->tp_dealloc((PyObject *)self);
}
static int
@@ -1524,14 +1525,10 @@
goto Done; \
}
- if (self->ob_type == &BucketType)
- assert(self->ob_type->tp_dictoffset == 0);
-
/* Call our base type's traverse function. Because buckets are
* subclasses of Peristent, there must be one.
*/
- assert(self->ob_type->tp_base->tp_traverse);
- err = self->ob_type->tp_base->tp_traverse((PyObject *)self, visit, arg);
+ err = cPersistenceCAPI->pertype->tp_traverse((PyObject *)self, visit, arg);
if (err)
goto Done;
@@ -1568,16 +1565,13 @@
#undef VISIT
}
-int
+static int
bucket_tp_clear(Bucket *self)
{
- /* Call our base type's clear function, if any. */
- if (self->ob_type->tp_base->tp_clear)
- self->ob_type->tp_base->tp_clear((PyObject *)self);
-
if (self->state != cPersistent_GHOST_STATE)
_bucket_clear(self);
- return 0;
+
+ return cPersistenceCAPI->pertype->tp_clear((PyObject *)self);
}
/* Code to access Bucket objects as mappings */
More information about the Zodb-checkins
mailing list