diff options
author | Dino Viehland <dinov@microsoft.com> | 2017-06-21 21:44:36 (GMT) |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2017-06-21 21:44:36 (GMT) |
commit | f3cffd2b7879d209f982de899b782fb89cfc410a (patch) | |
tree | 41c093d76571fc0e7676c0bb01980afc3029ed3f /Python | |
parent | c90e96015085784df86632b26059b19c80cbfc97 (diff) | |
download | cpython-f3cffd2b7879d209f982de899b782fb89cfc410a.zip cpython-f3cffd2b7879d209f982de899b782fb89cfc410a.tar.gz cpython-f3cffd2b7879d209f982de899b782fb89cfc410a.tar.bz2 |
bpo-30604: clean up co_extra support (#2144)
bpo-30604: port fix from 3.6 dropping binary compatibility tweaks
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 8 | ||||
-rw-r--r-- | Python/pystate.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 6140815..4e6911a 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -5287,14 +5287,14 @@ _Py_GetDXProfile(PyObject *self, PyObject *args) Py_ssize_t _PyEval_RequestCodeExtraIndex(freefunc free) { - PyThreadState *tstate = PyThreadState_Get(); + PyInterpreterState *interp = PyThreadState_Get()->interp; Py_ssize_t new_index; - if (tstate->co_extra_user_count == MAX_CO_EXTRA_USERS - 1) { + if (interp->co_extra_user_count == MAX_CO_EXTRA_USERS - 1) { return -1; } - new_index = tstate->co_extra_user_count++; - tstate->co_extra_freefuncs[new_index] = free; + new_index = interp->co_extra_user_count++; + interp->co_extra_freefuncs[new_index] = free; return new_index; } diff --git a/Python/pystate.c b/Python/pystate.c index 0e62ee9..24a08eb 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -111,6 +111,7 @@ PyInterpreterState_New(void) interp->importlib = NULL; interp->import_func = NULL; interp->eval_frame = _PyEval_EvalFrameDefault; + interp->co_extra_user_count = 0; #ifdef HAVE_DLOPEN #if HAVE_DECL_RTLD_NOW interp->dlopenflags = RTLD_NOW; @@ -281,7 +282,6 @@ new_threadstate(PyInterpreterState *interp, int init) tstate->coroutine_wrapper = NULL; tstate->in_coroutine_wrapper = 0; - tstate->co_extra_user_count = 0; tstate->async_gen_firstiter = NULL; tstate->async_gen_finalizer = NULL; |