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/2018-June/153862.html below:

[Python-Dev] Idea: reduce GC threshold in development mode (-X dev)

[Python-Dev] Idea: reduce GC threshold in development mode (-X dev) [Python-Dev] Idea: reduce GC threshold in development mode (-X dev)Serhiy Storchaka storchaka at gmail.com
Fri Jun 8 06:36:24 EDT 2018
08.06.18 11:31, Victor Stinner пише:
> Do you suggest to trigger a fake "GC collection" which would just
> visit all objects with a no-op visit callback? I like the idea!
>
> Yeah, that would help to detect objects in an inconsistent state and
> reuse the existing implemented visit methods of all types.
>
> Would you be interested to try to implement this new debug feature?

It is simple:

#ifdef Py_DEBUG
void
_PyGC_CheckConsistency(void)
{
     int i;
     if (_PyRuntime.gc.collecting) {
         return;
     }
     _PyRuntime.gc.collecting = 1;
     for (i = 0; i < NUM_GENERATIONS; ++i) {
         update_refs(GEN_HEAD(i));
     }
     for (i = 0; i < NUM_GENERATIONS; ++i) {
         subtract_refs(GEN_HEAD(i));
     }
     for (i = 0; i < NUM_GENERATIONS; ++i) {
         revive_garbage(GEN_HEAD(i));
     }
     _PyRuntime.gc.collecting = 0;
}
#endif

More information about the Python-Dev mailing list

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