]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Remove sys._deactivate_opcache() now that is not needed (GH-27154)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Thu, 15 Jul 2021 13:43:59 +0000 (14:43 +0100)
committerGitHub <noreply@github.com>
Thu, 15 Jul 2021 13:43:59 +0000 (14:43 +0100)
Lib/test/libregrtest/setup.py
Python/ceval.c
Python/clinic/sysmodule.c.h
Python/sysmodule.c

index 83ce2f73f4e5a62529b1ffd640576ceb61a3d8b5..345b58419995043d0e220439ae000f31aff4d5cd 100644 (file)
@@ -63,7 +63,6 @@ def setup_tests(ns):
 
     if ns.huntrleaks:
         unittest.BaseTestSuite._cleanup = False
-        sys._deactivate_opcache()
 
     if ns.memlimit is not None:
         support.set_memlimit(ns.memlimit)
index 1467c12fd5e4df49553a51b90a7106381d544d55..a6eb83a4909d72f928cc79635ed96bc277ba46b3 100644 (file)
@@ -106,19 +106,6 @@ static long dxp[256];
 #endif
 #endif
 
-/* per opcode cache */
-static int opcache_min_runs = 1024;  /* create opcache when code executed this many times */
-#define OPCODE_CACHE_MAX_TRIES 20
-
-// This function allows to deactivate the opcode cache. As different cache mechanisms may hold
-// references, this can mess with the reference leak detector functionality so the cache needs
-// to be deactivated in such scenarios to avoid false positives. See bpo-3714 for more information.
-void
-_PyEval_DeactivateOpCache(void)
-{
-    opcache_min_runs = 0;
-}
-
 #ifndef NDEBUG
 /* Ensure that tstate is valid: sanity check for PyEval_AcquireThread() and
    PyEval_RestoreThread(). Detect if tstate memory was freed. It can happen
index 763fe7a96fefa96dc0f1eaacd92e40257b919589..8350fbf98561a9db1fbe02abc69a90ff42f768b0 100644 (file)
@@ -965,24 +965,6 @@ sys_getandroidapilevel(PyObject *module, PyObject *Py_UNUSED(ignored))
 
 #endif /* defined(ANDROID_API_LEVEL) */
 
-PyDoc_STRVAR(sys__deactivate_opcache__doc__,
-"_deactivate_opcache($module, /)\n"
-"--\n"
-"\n"
-"Deactivate the opcode cache permanently");
-
-#define SYS__DEACTIVATE_OPCACHE_METHODDEF    \
-    {"_deactivate_opcache", (PyCFunction)sys__deactivate_opcache, METH_NOARGS, sys__deactivate_opcache__doc__},
-
-static PyObject *
-sys__deactivate_opcache_impl(PyObject *module);
-
-static PyObject *
-sys__deactivate_opcache(PyObject *module, PyObject *Py_UNUSED(ignored))
-{
-    return sys__deactivate_opcache_impl(module);
-}
-
 #ifndef SYS_GETWINDOWSVERSION_METHODDEF
     #define SYS_GETWINDOWSVERSION_METHODDEF
 #endif /* !defined(SYS_GETWINDOWSVERSION_METHODDEF) */
@@ -1010,4 +992,4 @@ sys__deactivate_opcache(PyObject *module, PyObject *Py_UNUSED(ignored))
 #ifndef SYS_GETANDROIDAPILEVEL_METHODDEF
     #define SYS_GETANDROIDAPILEVEL_METHODDEF
 #endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */
-/*[clinic end generated code: output=e77bf636a177c5c3 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=855fc93b2347710b input=a9049054013a1b77]*/
index b71a096eaa0fcbfba8c751d736dc63ed7e68ebee..f809e2fda560449c4536ef108f94f41d763a703a 100644 (file)
@@ -1971,22 +1971,6 @@ sys_getandroidapilevel_impl(PyObject *module)
 }
 #endif   /* ANDROID_API_LEVEL */
 
-
-/*[clinic input]
-sys._deactivate_opcache
-
-Deactivate the opcode cache permanently
-[clinic start generated code]*/
-
-static PyObject *
-sys__deactivate_opcache_impl(PyObject *module)
-/*[clinic end generated code: output=00e20982bd012122 input=501eac146735ccf9]*/
-{
-    _PyEval_DeactivateOpCache();
-    Py_RETURN_NONE;
-}
-
-
 static PyMethodDef sys_methods[] = {
     /* Might as well keep this in alphabetic order */
     SYS_ADDAUDITHOOK_METHODDEF
@@ -2040,7 +2024,6 @@ static PyMethodDef sys_methods[] = {
     SYS_GET_ASYNCGEN_HOOKS_METHODDEF
     SYS_GETANDROIDAPILEVEL_METHODDEF
     SYS_UNRAISABLEHOOK_METHODDEF
-    SYS__DEACTIVATE_OPCACHE_METHODDEF
     {NULL,              NULL}           /* sentinel */
 };