mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-128679: Use _PyThreadState_GET() in tracemalloc.c (#129126)
Replace uncommon PyGILState_GetThisThreadState() with common _PyThreadState_GET().
This commit is contained in:
parent
6a0f915aae
commit
31f149d5b3
1 changed files with 2 additions and 7 deletions
|
@ -338,13 +338,8 @@ traceback_hash(traceback_t *traceback)
|
|||
static void
|
||||
traceback_get_frames(traceback_t *traceback)
|
||||
{
|
||||
PyThreadState *tstate = PyGILState_GetThisThreadState();
|
||||
if (tstate == NULL) {
|
||||
#ifdef TRACE_DEBUG
|
||||
tracemalloc_error("failed to get the current thread state");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
assert(tstate != NULL);
|
||||
|
||||
_PyInterpreterFrame *pyframe = _PyThreadState_GetFrame(tstate);
|
||||
while (pyframe) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue