Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Python/tracemalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ tracemalloc_alloc(int need_gil, int use_calloc,
goto done;
}

PyGILState_STATE gil_state;
PyGILState_STATE gil_state = PyGILState_UNLOCKED;
if (need_gil) {
gil_state = PyGILState_Ensure();
}
Expand Down Expand Up @@ -575,7 +575,7 @@ tracemalloc_realloc(int need_gil, void *ctx, void *ptr, size_t new_size)
goto done;
}

PyGILState_STATE gil_state;
PyGILState_STATE gil_state = PyGILState_UNLOCKED;
if (need_gil) {
gil_state = PyGILState_Ensure();
}
Expand Down Expand Up @@ -1207,11 +1207,14 @@ int
PyTraceMalloc_Track(unsigned int domain, uintptr_t ptr,
size_t size)
{
PyGILState_STATE gil_state = PyGILState_UNLOCKED;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not needed.


if (_Py_atomic_load_int_relaxed(&tracemalloc_config.tracing) == 0) {
/* tracemalloc is not tracing: do nothing */
return -2;
}
PyGILState_STATE gil_state = PyGILState_Ensure();

gil_state = PyGILState_Ensure();
TABLES_LOCK();

int result;
Expand Down
Loading