[Python-Dev] GC and ExtensionClass

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Sat, 12 May 2001 21:16:58 +0200


> Has anyone investigated interactions between ExtensionClass objects
> and GC?

At some point, extension classes used a literal copy of
PyTypeObject. Unfortunately, that copy was made with Python 1.4 or so,
and only had the spare fields that were expected then. Today,
PyTypeObject has much more fields, so extension objects produce random
errors (eg. with GC) when used in a modern interpreter (where the copy
has not been synchronized). Whatever immediately follows the type
object in memory may be interpreted as GC flag.

Regards,
Martin