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.
This commit is contained in:
Inada Naoki 2019-06-04 07:38:10 +09:00 committed by Victor Stinner
parent 0f0a30f4da
commit eddef861b4
1 changed files with 7 additions and 0 deletions

View File

@ -103,7 +103,14 @@ static long dxp[256];
#endif #endif
/* per opcode cache */ /* 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 */ #define OPCACHE_MIN_RUNS 1024 /* create opcache when code executed this time */
#endif
#define OPCACHE_STATS 0 /* Enable stats */ #define OPCACHE_STATS 0 /* Enable stats */
#if OPCACHE_STATS #if OPCACHE_STATS