[Python-3000] Delayed reference counting idea

"Martin v. Löwis" martin at v.loewis.de
Mon Sep 18 23:16:01 CEST 2006


Raymond Hettinger schrieb:
> * An easier C API would significantly benefit the language in terms of
> more extensions being available and in terms of increased reliability
> for those extensions.  The current refcount scheme results in pervasive
> refleak bugs and subsequent, interminable bughunts.  It adds to code
> verbosity/complexity and makes it tricky for beginning extension writers
> to get their first apps done correctly.  IOW, I agree that GC without
> refcounts will make it easier to write good C code.

I don't think this will be the case. A garbage collector will likely
need to find out what the pointer local and global variables are,
as well as the pointers hidden in C structures (at least if the
collector is going to be "precise").

So I think a Python with "true" GC will be much more error-prone
on the C level, with authors not getting the declarations of
variables right, and endless bug hunts because a referenced object
is already collected, and its memory overwritten.

Regards,
Martin


More information about the Python-3000 mailing list