A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-February/020252.html below:

[Python-Dev] A little GC confusion

[Python-Dev] A little GC confusion [Python-Dev] A little GC confusionDavid Abrahams David Abrahams" <david.abrahams@rcn.com
Fri, 22 Feb 2002 08:07:28 -0500
----- Original Message -----
From: "David Abrahams" <david.abrahams@rcn.com>

> ----- Original Message -----
> From: "Martin v. Loewis" <martin@v.loewis.de>

> > Because the type type implements tp_is_gc (typeobject.c:1378),
> > declaring static type objects as not being gc. In turn, garbage
> > collection will not attempt to look at the GC header of these type
> > objects.
>
>
> Aha! And the implementation is...
>
> static int
> type_is_gc(PyTypeObject *type)
> {
>     return type->tp_flags & Py_TPFLAGS_HEAPTYPE;
> }
>
> so, wouldn't it make more sense that the Python source always checks
> Py_TPFLAGS_HEAPTYPE before tp_is_gc?

Nice try, but no cigar I'm afraid: copying the tp_is_gc slot from
PyType_Type into my metatype before PyType_Ready() doesn't prevent the
crash.

Does anyone really understand what happens here?





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4