[Patches] GC infrastructure patch 1 (tp_recurse, tp_clear)

Neil Schemenauer nascheme@enme.ucalgary.ca
Tue, 20 Jun 2000 16:03:37 -0600


On Tue, Jun 20, 2000 at 05:52:51PM -0400, Jeremy Hylton wrote:
> This patch defines the recurse function as 
> typedef int (*recurseproc) Py_PROTO((PyObject *, visitproc, void *));
> 
> What is the return value for?

The GC doesn't need it but I thought it might be useful in the
future.

> A number of the recurse functions return 1 unless a call to
> visit fails. Some return 1 even if a visit call returns 0.

Oops, those should be fixed.  tp_recurse should return 0 if any
called visit function does (ie. it fails).  The GC visit
functions all return success (ie. 1).

> It seems like it would make more sense to make it 
> typedef void (*recurseproc) Py_PROTO((PyObject *, visitproc, void *));
> 
> Or to define the return values and be consistent about checking error
> returns.

Can anyone think of a use for the return value?  I guess it could
be added back if someone found a use of it.

    Neil