[Python-checkins] cpython: Close #19199: Remove ``PyThreadState.tick_counter`` field

victor.stinner python-checkins at python.org
Wed Oct 9 14:53:18 CEST 2013


http://hg.python.org/cpython/rev/3ce0102e4c1f
changeset:   86185:3ce0102e4c1f
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Wed Oct 09 14:53:01 2013 +0200
summary:
  Close #19199: Remove ``PyThreadState.tick_counter`` field

files:
  Doc/whatsnew/3.4.rst |   3 ++-
  Include/pystate.h    |  10 ----------
  Misc/NEWS            |   2 ++
  Python/ceval.c       |   1 -
  Python/pystate.c     |   1 -
  5 files changed, 4 insertions(+), 13 deletions(-)


diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst
--- a/Doc/whatsnew/3.4.rst
+++ b/Doc/whatsnew/3.4.rst
@@ -523,7 +523,8 @@
 Deprecated functions and types of the C API
 -------------------------------------------
 
-* None yet.
+* The ``PyThreadState.tick_counter`` field has been value: its value was meaningless
+  since Python 3.2 ("new GIL").
 
 
 Deprecated features
diff --git a/Include/pystate.h b/Include/pystate.h
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -100,16 +100,6 @@
 
     PyObject *dict;  /* Stores per-thread state */
 
-    /* XXX doesn't mean anything anymore (the comment below is obsolete)
-       => deprecate or remove? */
-    /* tick_counter is incremented whenever the check_interval ticker
-     * reaches zero. The purpose is to give a useful measure of the number
-     * of interpreted bytecode instructions in a given thread.  This
-     * extremely lightweight statistic collector may be of interest to
-     * profilers (like psyco.jit()), although nothing in the core uses it.
-     */
-    int tick_counter;
-
     int gilstate_counter;
 
     PyObject *async_exc; /* Asynchronous exception to raise */
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,8 @@
 Core and Builtins
 -----------------
 
+- Issue #19199: Remove ``PyThreadState.tick_counter`` field
+
 - Fix macro expansion of _PyErr_OCCURRED(), and make sure to use it in at
   least one place so as to avoid regressions.
 
diff --git a/Python/ceval.c b/Python/ceval.c
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1247,7 +1247,6 @@
                    a try: finally: block uninterruptible. */
                 goto fast_next_opcode;
             }
-            tstate->tick_counter++;
 #ifdef WITH_TSC
             ticked = 1;
 #endif
diff --git a/Python/pystate.c b/Python/pystate.c
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -182,7 +182,6 @@
         tstate->recursion_critical = 0;
         tstate->tracing = 0;
         tstate->use_tracing = 0;
-        tstate->tick_counter = 0;
         tstate->gilstate_counter = 0;
         tstate->async_exc = NULL;
 #ifdef WITH_THREAD

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list