[Python-checkins] r82577 - python/branches/py3k/Objects/typeobject.c
benjamin.peterson
python-checkins at python.org
Mon Jul 5 17:01:22 CEST 2010
Author: benjamin.peterson
Date: Mon Jul 5 17:01:22 2010
New Revision: 82577
Log:
cleanup basicsize logic #3268
Modified:
python/branches/py3k/Objects/typeobject.c
Modified: python/branches/py3k/Objects/typeobject.c
==============================================================================
--- python/branches/py3k/Objects/typeobject.c (original)
+++ python/branches/py3k/Objects/typeobject.c Mon Jul 5 17:01:22 2010
@@ -3476,11 +3476,8 @@
static void
inherit_special(PyTypeObject *type, PyTypeObject *base)
{
- Py_ssize_t oldsize, newsize;
/* Copying basicsize is connected to the GC flags */
- oldsize = base->tp_basicsize;
- newsize = type->tp_basicsize ? type->tp_basicsize : oldsize;
if (!(type->tp_flags & Py_TPFLAGS_HAVE_GC) &&
(base->tp_flags & Py_TPFLAGS_HAVE_GC) &&
(!type->tp_traverse && !type->tp_clear)) {
@@ -3507,7 +3504,8 @@
type->tp_new = base->tp_new;
}
}
- type->tp_basicsize = newsize;
+ if (type->tp_basicsize == 0)
+ type->tp_basicsize = base->tp_basicsize;
/* Copy other non-function slots */
More information about the Python-checkins
mailing list