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

M.-A. Lemburg mal@lemburg.com
Thu, 15 Jun 2000 10:39:24 +0200


Moshe Zadka wrote:
> 
> On Wed, 14 Jun 2000, Neil Schemenauer wrote:
> 
> > This patch adds the type methods recurse and clear necessary for
> > my GC patch.  It is straightforward so hopefully it can be
> > applied right away.
> 
> a) As spammy as it sounds, you probably want to send this patch again with
> the legal mumbo-jumbo...
> 
> b) +0.5, because you are eating into 2 spare slots. Couldn't you just
> waste one, and have it point into a structure with those two functions?
> I'd certainly be +1 on that.

I don't see much of a problem here. IIRC Guido wasn't too happy
with the current implementation of protocols (via pointers to
structs), so Neil's approach is in line with the "new" strategy to
include all slots at top-level.

BTW, type objects don't cost anything (there's only one per
object type, not one per object), so there really isn't
all that much to bother about.

The patch set looks ok to me... at least as far as I understand
it. I'm certainly +1 on the strategy which is used.

Some questions:

* what's the impact of having GC enabled for the class of
  well bahaved programs (those which do not create cyclic
  garbage) ?

* would it be possible to disable automatic collection and
  implement a custom collection invocation scheme ?

* what would an extension type have to do/implement to
  participate in GC ?

* would an extension compiled with GC still work together
  with an interpreter which is not (and vice-versa) ?
  [This one is of particular importance to me for obvious
  reasons.]

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/