bpo-39489: Remove COUNT_ALLOCS special build (GH-18259)

Remove:

* COUNT_ALLOCS macro
* sys.getcounts() function
* SHOW_ALLOC_COUNT code in listobject.c
* SHOW_TRACK_COUNT code in tupleobject.c
* PyConfig.show_alloc_count field
* -X showalloccount command line option
* @test.support.requires_type_collecting decorator
This commit is contained in:
Victor Stinner 2020-02-03 15:17:15 +01:00 committed by GitHub
parent 869c0c99b9
commit c6e5c1123b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 24 additions and 469 deletions

View file

@ -1173,10 +1173,6 @@ Py_Initialize(void)
}
#ifdef COUNT_ALLOCS
extern void _Py_dump_counts(FILE*);
#endif
/* Flush stdout and stderr */
static int
@ -1393,13 +1389,6 @@ Py_FinalizeEx(void)
* XXX I haven't seen a real-life report of either of these.
*/
_PyGC_CollectIfEnabled();
#ifdef COUNT_ALLOCS
/* With COUNT_ALLOCS, it helps to run GC multiple times:
each collection might release some types from the type
list, so they become garbage. */
while (_PyGC_CollectIfEnabled() > 0)
/* nothing */;
#endif
/* Clear all loghooks */
/* We want minimal exposure of this function, so define the extern
@ -1451,10 +1440,6 @@ Py_FinalizeEx(void)
/* unload faulthandler module */
_PyFaulthandler_Fini();
/* Debugging stuff */
#ifdef COUNT_ALLOCS
_Py_dump_counts(stderr);
#endif
/* dump hash stats */
_PyHash_Fini();