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

Jeremy Hylton jeremy@beopen.com
Wed, 21 Jun 2000 13:26:21 -0400 (EDT)


>>>>> "NS" == Neil Schemenauer <nascheme@enme.ucalgary.ca> writes:

  NS> On Wed, Jun 21, 2000 at 10:16:11AM -0400, Jeremy Hylton wrote:
  >> I'm still not convinced that a return value is useful.  Here's an
  >> example of a function that uses the recurse code and visit code.

  NS> Hmm, I guess my last message wasn't too clear.  The GC code does
  NS> not use the return value.  tp_recurse takes a function pointer
  NS> as an argument.  visitproc could possibly return a non-zero
  NS> status code but all the visitprocs in the GC return success.
  NS> If, in the future, someone else finds a use for tp_recurse they
  NS> may wish to return a status value from their visitproc.

  NS> I have been a little sloppy with the return values since the GC
  NS> didn't need them.  My fault.  For optimal flexibility if
  NS> visitproc returns a non-zero value the tp_recurse functions
  NS> should return it instead of 1.

How about zero for failure?  The the recurse function returns one
unless the visit function returns zero.

Then we define the recurse/visit protocol so that the caller of the
recurse function can ignore the error code only if it can guarantee
that the visit function will never return an error.

If there are no objections, I'll make the changes and check in
patch1.

Jeremy