Skip to content

Commit 4cb7263

Browse files
authored
Remove sys._deactivate_opcache() now that is not needed (pythonGH-27154)
1 parent f333ab0 commit 4cb7263

File tree

4 files changed

+1
-50
lines changed

4 files changed

+1
-50
lines changed

Lib/test/libregrtest/setup.py

-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ def setup_tests(ns):
6363

6464
if ns.huntrleaks:
6565
unittest.BaseTestSuite._cleanup = False
66-
sys._deactivate_opcache()
6766

6867
if ns.memlimit is not None:
6968
support.set_memlimit(ns.memlimit)

Python/ceval.c

-13
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,6 @@ static long dxp[256];
106106
#endif
107107
#endif
108108

109-
/* per opcode cache */
110-
static int opcache_min_runs = 1024; /* create opcache when code executed this many times */
111-
#define OPCODE_CACHE_MAX_TRIES 20
112-
113-
// This function allows to deactivate the opcode cache. As different cache mechanisms may hold
114-
// references, this can mess with the reference leak detector functionality so the cache needs
115-
// to be deactivated in such scenarios to avoid false positives. See bpo-3714 for more information.
116-
void
117-
_PyEval_DeactivateOpCache(void)
118-
{
119-
opcache_min_runs = 0;
120-
}
121-
122109
#ifndef NDEBUG
123110
/* Ensure that tstate is valid: sanity check for PyEval_AcquireThread() and
124111
PyEval_RestoreThread(). Detect if tstate memory was freed. It can happen

Python/clinic/sysmodule.c.h

+1-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/sysmodule.c

-17
Original file line numberDiff line numberDiff line change
@@ -1971,22 +1971,6 @@ sys_getandroidapilevel_impl(PyObject *module)
19711971
}
19721972
#endif /* ANDROID_API_LEVEL */
19731973

1974-
1975-
/*[clinic input]
1976-
sys._deactivate_opcache
1977-
1978-
Deactivate the opcode cache permanently
1979-
[clinic start generated code]*/
1980-
1981-
static PyObject *
1982-
sys__deactivate_opcache_impl(PyObject *module)
1983-
/*[clinic end generated code: output=00e20982bd012122 input=501eac146735ccf9]*/
1984-
{
1985-
_PyEval_DeactivateOpCache();
1986-
Py_RETURN_NONE;
1987-
}
1988-
1989-
19901974
static PyMethodDef sys_methods[] = {
19911975
/* Might as well keep this in alphabetic order */
19921976
SYS_ADDAUDITHOOK_METHODDEF
@@ -2040,7 +2024,6 @@ static PyMethodDef sys_methods[] = {
20402024
SYS_GET_ASYNCGEN_HOOKS_METHODDEF
20412025
SYS_GETANDROIDAPILEVEL_METHODDEF
20422026
SYS_UNRAISABLEHOOK_METHODDEF
2043-
SYS__DEACTIVATE_OPCACHE_METHODDEF
20442027
{NULL, NULL} /* sentinel */
20452028
};
20462029

0 commit comments

Comments
 (0)