summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-02-03 14:17:15 (GMT)
committerGitHub <noreply@github.com>2020-02-03 14:17:15 (GMT)
commitc6e5c1123bac6cbb4c85265155af5349dcea522e (patch)
treec9bc04bdd74fbf9d8f86dd1999d8acc0f4655fc3 /Doc/c-api
parent869c0c99b94ff9527acc1ca060164ab3d1bdcc53 (diff)
downloadcpython-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/c-api')
-rw-r--r--Doc/c-api/init_config.rst12
-rw-r--r--Doc/c-api/typeobj.rst34
2 files changed, 4 insertions, 42 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