cpython/Objects
Guido van Rossum 048eb75c2d Add Garbage Collection support to new-style classes (not yet to their
instances).

Also added GC support to various auxiliary types: super, property,
descriptors, wrappers, dictproxy.  (Only type objects have a tp_clear
field; the other types are.)

One change was necessary to the GC infrastructure.  We have statically
allocated type objects that don't have a GC header (and can't easily
be given one) and heap-allocated type objects that do have a GC
header.  Giving these different metatypes would be really ugly: I
tried, and I had to modify pickle.py, cPickle.c, copy.py, add a new
invent a new name for the new metatype and make it a built-in, change
affected tests...  In short, a mess.  So instead, we add a new type
slot tp_is_gc, which is a simple Boolean function that determines
whether a particular instance has GC headers or not.  This slot is
only relevant for types that have the (new) GC flag bit set.  If the
tp_is_gc slot is NULL (by far the most common case), all instances of
the type are deemed to have GC headers.  This slot is called by the
PyObject_IS_GC() macro (which is only used twice, both times in
gcmodule.c).

I also changed the extern declarations for a bunch of GC-related
functions (_PyObject_GC_Del etc.): these always exist but objimpl.h
only declared them when WITH_CYCLE_GC was defined, but I needed to be
able to reference them without #ifdefs.  (When WITH_CYCLE_GC is not
defined, they do the same as their non-GC counterparts anyway.)
2001-10-02 21:24:57 +00:00
..
.cvsignore Ignore a bunch of generated files. 2000-05-02 18:34:30 +00:00
abstract.c binary_op1(), ternary_op(): rearrange the code so that slotw is tested 2001-10-01 17:10:18 +00:00
bufferobject.c repr's converted to using PyString_FromFormat() instead of sprintf'ing 2001-08-24 18:34:26 +00:00
cellobject.c Use new GC API. 2001-08-29 23:54:21 +00:00
classobject.c SF bug [#466173] unpack TypeError unclear 2001-09-30 05:58:42 +00:00
cobject.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
complexobject.c Merge branch changes (coercion, rich comparisons) into trunk. 2001-09-27 20:30:07 +00:00
descrobject.c Add Garbage Collection support to new-style classes (not yet to their 2001-10-02 21:24:57 +00:00
dictobject.c Changed the dict implementation to take "string shortcuts" only when 2001-09-14 00:25:33 +00:00
fileobject.c Generalize file.writelines() to allow iterable objects. 2001-09-23 04:06:05 +00:00
floatobject.c Add additional coercion support for "self subtypes" to int, long, 2001-09-19 01:25:16 +00:00
frameobject.c Add optional docstrings to getset descriptors. Fortunately, there's 2001-09-20 21:45:26 +00:00
funcobject.c Add optional docstrings to getset descriptors. Fortunately, there's 2001-09-20 21:45:26 +00:00
intobject.c Add additional coercion support for "self subtypes" to int, long, 2001-09-19 01:25:16 +00:00
iterobject.c Patch #427190: Implement and use METH_NOARGS and METH_O. 2001-08-16 13:15:00 +00:00
listobject.c Give the internal immutable list type .extend and .pop methods (they 2001-08-30 06:15:32 +00:00
longobject.c SF [#466125] PyLong_AsLongLong works for any integer. 2001-09-30 05:09:37 +00:00
methodobject.c Add optional docstrings to getset descriptors. Fortunately, there's 2001-09-20 21:45:26 +00:00
moduleobject.c Add optional docstrings to member descriptors. For backwards 2001-09-20 20:46:19 +00:00
object.c Merge branch changes (coercion, rich comparisons) into trunk. 2001-09-27 20:30:07 +00:00
obmalloc.c Identifiers matching _[A-Z_]\w* are reserved for C implementations. 2001-03-11 18:36:13 +00:00
rangeobject.c repr's converted to using PyString_FromFormat() instead of sprintf'ing 2001-08-24 18:34:26 +00:00
sliceobject.c Add optional docstrings to member descriptors. For backwards 2001-09-20 20:46:19 +00:00
stringobject.c Merge branch changes (coercion, rich comparisons) into trunk. 2001-09-27 20:30:07 +00:00
tupleobject.c The endless 460020 bug. 2001-09-11 19:48:03 +00:00
typeobject.c Add Garbage Collection support to new-style classes (not yet to their 2001-10-02 21:24:57 +00:00
unicodectype.c removed "register const" from scalar arguments to the unicode 2001-06-27 22:08:26 +00:00
unicodeobject.c Fix a bug in rendering of \\ by repr() -- it rendered as \\\ instead 2001-09-21 15:38:17 +00:00
unicodetype_db.h forgot to check in the new makeunicodedata.py script 2001-01-21 17:01:31 +00:00
xxobject.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00