diff options
author | Victor Stinner <vstinner@python.org> | 2020-02-03 14:17:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-03 14:17:15 (GMT) |
commit | c6e5c1123bac6cbb4c85265155af5349dcea522e (patch) | |
tree | c9bc04bdd74fbf9d8f86dd1999d8acc0f4655fc3 /Doc | |
parent | 869c0c99b94ff9527acc1ca060164ab3d1bdcc53 (diff) | |
download | cpython-c6e5c1123bac6cbb4c85265155af5349dcea522e.zip cpython-c6e5c1123bac6cbb4c85265155af5349dcea522e.tar.gz cpython-c6e5c1123bac6cbb4c85265155af5349dcea522e.tar.bz2 |
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
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/init_config.rst | 12 | ||||
-rw-r--r-- | Doc/c-api/typeobj.rst | 34 | ||||
-rw-r--r-- | Doc/using/cmdline.rst | 5 | ||||
-rw-r--r-- | Doc/whatsnew/3.9.rst | 9 |
4 files changed, 15 insertions, 45 deletions
diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst index 108bd2c..c589a6f 100644 --- a/Doc/c-api/init_config.rst +++ b/Doc/c-api/init_config.rst @@ -627,14 +627,6 @@ PyConfig ``python3 -m MODULE`` argument. Used by :c:func:`Py_RunMain`. - .. c:member:: int show_alloc_count - - Show allocation counts at exit? - - Set to 1 by :option:`-X showalloccount <-X>` command line option. - - Need a special Python build with ``COUNT_ALLOCS`` macro defined. - .. c:member:: int show_ref_count Show total reference count at exit? @@ -702,6 +694,10 @@ arguments are stripped from ``argv``: see :ref:`Command Line Arguments The ``xoptions`` options are parsed to set other options: see :option:`-X` option. +.. versionchanged:: 3.9 + + The ``show_alloc_count`` field has been removed. + Initialization with PyConfig ---------------------------- diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index 7b205c0..a8a779e 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -148,15 +148,6 @@ Quick Reference | :c:member:`~PyTypeObject.tp_vectorcall` | :c:type:`vectorcallfunc` | | | | | | +------------------------------------------------+-----------------------------------+-------------------+---+---+---+---+ -If :const:`COUNT_ALLOCS` is defined then the following (internal-only) -fields exist as well: - -* :c:member:`~PyTypeObject.tp_allocs` -* :c:member:`~PyTypeObject.tp_frees` -* :c:member:`~PyTypeObject.tp_maxalloc` -* :c:member:`~PyTypeObject.tp_prev` -* :c:member:`~PyTypeObject.tp_next` - .. [#slots] A slot name in parentheses indicates it is (effectively) deprecated. Names in angle brackets should be treated as read-only. @@ -1904,31 +1895,6 @@ and :c:type:`PyType_Type` effectively act as defaults.) .. versionadded:: 3.9 (the field exists since 3.8 but it's only used since 3.9) -The remaining fields are only defined if the feature test macro -:const:`COUNT_ALLOCS` is defined, and are for internal use only. They are -documented here for completeness. None of these fields are inherited by -subtypes. - -.. c:member:: Py_ssize_t PyTypeObject.tp_allocs - - Number of allocations. - -.. c:member:: Py_ssize_t PyTypeObject.tp_frees - - Number of frees. - -.. c:member:: Py_ssize_t PyTypeObject.tp_maxalloc - - Maximum simultaneously allocated objects. - -.. c:member:: PyTypeObject* PyTypeObject.tp_prev - - Pointer to the previous type object with a non-zero :c:member:`~PyTypeObject.tp_allocs` field. - -.. c:member:: PyTypeObject* PyTypeObject.tp_next - - Pointer to the next type object with a non-zero :c:member:`~PyTypeObject.tp_allocs` field. - Also, note that, in a garbage collected Python, :c:member:`~PyTypeObject.tp_dealloc` may be called from any Python thread, not just the thread which created the object (if the object becomes part of a refcount cycle, that cycle might be collected by a garbage diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index fb88673..2206e50 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -434,9 +434,6 @@ Miscellaneous options stored in a traceback of a trace. Use ``-X tracemalloc=NFRAME`` to start tracing with a traceback limit of *NFRAME* frames. See the :func:`tracemalloc.start` for more information. - * ``-X showalloccount`` to output the total count of allocated objects for - each type when the program finishes. This only works when Python was built with - ``COUNT_ALLOCS`` defined. * ``-X importtime`` to show how long each import takes. It shows module name, cumulative time (including nested imports) and self time (excluding nested imports). Note that its output may be broken in multi-threaded @@ -479,6 +476,8 @@ Miscellaneous options Using ``-X dev`` option, check *encoding* and *errors* arguments on string encoding and decoding operations. + The ``-X showalloccount`` option has been removed. + Options you shouldn't use ~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 931f8bf..3b7a9d1 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -348,6 +348,9 @@ Build and C API Changes functions are now required to build Python. (Contributed by Victor Stinner in :issue:`39395`.) +* The ``COUNT_ALLOCS`` special build macro has been removed. + (Contributed by Victor Stinner in :issue:`39489`.) + Deprecated ========== @@ -484,6 +487,12 @@ Removed ``asyncio.Condition`` and ``asyncio.Semaphore``. (Contributed by Andrew Svetlov in :issue:`34793`.) +* The :func:`sys.getcounts` function, the ``-X showalloccount`` command line + option and the ``show_alloc_count`` field of the C structure + :c:type:`PyConfig` have been removed. They required a special Python build by + defining ``COUNT_ALLOCS`` macro. + (Contributed by Victor Stinner in :issue:`39489`.) + Porting to Python 3.9 ===================== |