mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +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
|
static void
|
||||||
traceback_get_frames(traceback_t *traceback)
|
traceback_get_frames(traceback_t *traceback)
|
||||||
{
|
{
|
||||||
PyThreadState *tstate = PyGILState_GetThisThreadState();
|
PyThreadState *tstate = _PyThreadState_GET();
|
||||||
if (tstate == NULL) {
|
assert(tstate != NULL);
|
||||||
#ifdef TRACE_DEBUG
|
|
||||||
tracemalloc_error("failed to get the current thread state");
|
|
||||||
#endif
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_PyInterpreterFrame *pyframe = _PyThreadState_GetFrame(tstate);
|
_PyInterpreterFrame *pyframe = _PyThreadState_GetFrame(tstate);
|
||||||
while (pyframe) {
|
while (pyframe) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue