summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-03-22 23:17:54 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-03-22 23:17:54 (GMT)
commit35b0fd74dd549b1593f0486e78e40b3da539ea0d (patch)
tree408d853e4d6c56e60d0d0ca465c23e3506b63438 /Modules
parentf9a71153e9122a3d2bb86fc479bdda2f2adc859e (diff)
parentd5871e62ddf1e826b3aa1fdc0cb888e6090e5408 (diff)
downloadcpython-35b0fd74dd549b1593f0486e78e40b3da539ea0d.zip
cpython-35b0fd74dd549b1593f0486e78e40b3da539ea0d.tar.gz
cpython-35b0fd74dd549b1593f0486e78e40b3da539ea0d.tar.bz2
Merge 3.5
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_tracemalloc.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
index 77742de..3d96860 100644
--- a/Modules/_tracemalloc.c
+++ b/Modules/_tracemalloc.c
@@ -216,7 +216,7 @@ get_reentrant(void)
static void
set_reentrant(int reentrant)
{
- assert(!reentrant || !get_reentrant());
+ assert(reentrant != tracemalloc_reentrant);
tracemalloc_reentrant = reentrant;
}
#endif
@@ -879,10 +879,6 @@ tracemalloc_clear_traces(void)
assert(PyGILState_Check());
#endif
- /* Disable also reentrant calls to tracemalloc_malloc() to not add a new
- trace while we are clearing traces */
- assert(get_reentrant());
-
TABLES_LOCK();
_Py_hashtable_clear(tracemalloc_traces);
tracemalloc_traced_memory = 0;
@@ -971,11 +967,6 @@ tracemalloc_init(void)
tracemalloc_empty_traceback.frames[0].lineno = 0;
tracemalloc_empty_traceback.hash = traceback_hash(&tracemalloc_empty_traceback);
- /* Disable tracing allocations until hooks are installed. Set
- also the reentrant flag to detect bugs: fail with an assertion error
- if set_reentrant(1) is called while tracing is disabled. */
- set_reentrant(1);
-
tracemalloc_config.initialized = TRACEMALLOC_INITIALIZED;
return 0;
}
@@ -1063,7 +1054,6 @@ tracemalloc_start(int max_nframe)
/* everything is ready: start tracing Python memory allocations */
tracemalloc_config.tracing = 1;
- set_reentrant(0);
return 0;
}
@@ -1078,10 +1068,6 @@ tracemalloc_stop(void)
/* stop tracing Python memory allocations */
tracemalloc_config.tracing = 0;
- /* set the reentrant flag to detect bugs: fail with an assertion error if
- set_reentrant(1) is called while tracing is disabled. */
- set_reentrant(1);
-
/* unregister the hook on memory allocators */
#ifdef TRACE_RAW_MALLOC
PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &allocators.raw);