summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2019-06-03 22:38:10 (GMT)
committerVictor Stinner <vstinner@redhat.com>2019-06-03 22:38:09 (GMT)
commiteddef861b49f1635222a9e1771231c34a807debf (patch)
tree254bbdec06edfdca92d8e1ab6ab2e53652ac3875 /Python
parent0f0a30f4da4b529e0f7df857b9f575b231b32758 (diff)
downloadcpython-eddef861b49f1635222a9e1771231c34a807debf.zip
cpython-eddef861b49f1635222a9e1771231c34a807debf.tar.gz
cpython-eddef861b49f1635222a9e1771231c34a807debf.tar.bz2
bpo-37146: disable opcache when Py_DEBUG is defined (GH-13787)
--with-pydebug is commonly used to find memory leaks. But opcache makes it harder. So disable opcache when Py_DEBUG is defined.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 0a4af91..2590ce6 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -103,7 +103,14 @@ static long dxp[256];
#endif
/* per opcode cache */
+#ifdef Py_DEBUG
+// --with-pydebug is used to find memory leak. opcache makes it harder.
+// So we disable opcache when Py_DEBUG is defined.
+// See bpo-37146
+#define OPCACHE_MIN_RUNS 0 /* disable opcache */
+#else
#define OPCACHE_MIN_RUNS 1024 /* create opcache when code executed this time */
+#endif
#define OPCACHE_STATS 0 /* Enable stats */
#if OPCACHE_STATS