Staging
v0.5.1
v0.5.1
https://github.com/python/cpython
Revision 97719c9ce56bfb19fa7b0833c8c7947ad2fd7e52 authored by Tim Peters on 21 May 2003, 20:43:10 UTC, committed by Tim Peters on 21 May 2003, 20:43:10 UTC
tp_free is NULL or PyObject_Del at the end. Because it's a base type it must call tp_free in its dealloc function, and because it's gc'able it must not call PyObject_Del. inherit_slots(): Don't inherit tp_free unless the type and its base agree about whether they're gc'able. If the type is gc'able and the base is not, and the base uses the default PyObject_Del for its tp_free, give the type PyObject_GC_Del for its tp_free (the appropriate default for a gc'able type). cPickle.c: The Pickler and Unpickler types claim to be base classes and gc'able, but their dealloc functions didn't call tp_free. Repaired that. Also call PyType_Ready() on these typeobjects, so that the correct (PyObject_GC_Del) default memory-freeing function gets plugged into these types' tp_free slots.
1 parent 54d9cdf
Tip revision: 97719c9ce56bfb19fa7b0833c8c7947ad2fd7e52 authored by Tim Peters on 21 May 2003, 20:43:10 UTC
PyType_Ready(): Complain if the type is a base type, and gc'able, and
PyType_Ready(): Complain if the type is a base type, and gc'able, and
Tip revision: 97719c9
File | Mode | Size |
---|---|---|
.cvsignore | -rw-r--r-- | 17 bytes |
abstract.c | -rw-r--r-- | 43.5 KB |
bufferobject.c | -rw-r--r-- | 11.2 KB |
cellobject.c | -rw-r--r-- | 2.3 KB |
classobject.c | -rw-r--r-- | 56.2 KB |
cobject.c | -rw-r--r-- | 3.6 KB |
complexobject.c | -rw-r--r-- | 22.0 KB |
descrobject.c | -rw-r--r-- | 26.0 KB |
dictobject.c | -rw-r--r-- | 49.8 KB |
fileobject.c | -rw-r--r-- | 43.5 KB |
floatobject.c | -rw-r--r-- | 21.8 KB |
frameobject.c | -rw-r--r-- | 12.3 KB |
funcobject.c | -rw-r--r-- | 16.6 KB |
intobject.c | -rw-r--r-- | 25.3 KB |
iterobject.c | -rw-r--r-- | 5.5 KB |
listobject.c | -rw-r--r-- | 44.9 KB |
longobject.c | -rw-r--r-- | 52.5 KB |
methodobject.c | -rw-r--r-- | 7.0 KB |
moduleobject.c | -rw-r--r-- | 5.6 KB |
object.c | -rw-r--r-- | 47.8 KB |
obmalloc.c | -rw-r--r-- | 22.2 KB |
rangeobject.c | -rw-r--r-- | 7.1 KB |
sliceobject.c | -rw-r--r-- | 4.7 KB |
stringobject.c | -rw-r--r-- | 90.5 KB |
structseq.c | -rw-r--r-- | 8.6 KB |
tupleobject.c | -rw-r--r-- | 14.6 KB |
typeobject.c | -rw-r--r-- | 110.8 KB |
unicodectype.c | -rw-r--r-- | 8.6 KB |
unicodeobject.c | -rw-r--r-- | 145.4 KB |
unicodetype_db.h | -rw-r--r-- | 37.0 KB |
weakrefobject.c | -rw-r--r-- | 21.0 KB |
xxobject.c | -rw-r--r-- | 2.4 KB |
Computing file changes ...