Skip to content

Commit 6427b6e

Browse files
committed
No need to use atomics here
1 parent ae33ca8 commit 6427b6e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Python/gc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,7 +2074,7 @@ _PyGC_Collect(PyThreadState *tstate, int generation, _PyGC_Reason reason)
20742074
// Don't start a garbage collection if one is already in progress.
20752075
return 0;
20762076
}
2077-
_Py_atomic_store_ptr(&gcstate->frame, tstate->current_frame);
2077+
gcstate->frame = tstate->current_frame;
20782078

20792079
struct gc_collection_stats stats = { 0 };
20802080
if (reason != _Py_GC_REASON_SHUTDOWN) {
@@ -2120,7 +2120,7 @@ _PyGC_Collect(PyThreadState *tstate, int generation, _PyGC_Reason reason)
21202120
}
21212121
#endif
21222122
validate_spaces(gcstate);
2123-
_Py_atomic_store_ptr(&gcstate->frame, NULL);
2123+
gcstate->frame = NULL;
21242124
_Py_atomic_store_int(&gcstate->collecting, 0);
21252125

21262126
if (gcstate->debug & _PyGC_DEBUG_STATS) {

Python/gc_free_threading.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2358,7 +2358,7 @@ gc_collect_main(PyThreadState *tstate, int generation, _PyGC_Reason reason)
23582358
_Py_atomic_store_int(&gcstate->collecting, 0);
23592359
return 0;
23602360
}
2361-
_Py_atomic_store_ptr(&gcstate->frame, tstate->current_frame);
2361+
gcstate->frame = tstate->current_frame;
23622362

23632363
assert(generation >= 0 && generation < NUM_GENERATIONS);
23642364

@@ -2447,7 +2447,7 @@ gc_collect_main(PyThreadState *tstate, int generation, _PyGC_Reason reason)
24472447
}
24482448

24492449
assert(!_PyErr_Occurred(tstate));
2450-
_Py_atomic_store_ptr(&gcstate->frame, NULL);
2450+
gcstate->frame = NULL;
24512451
_Py_atomic_store_int(&gcstate->collecting, 0);
24522452
return n + m;
24532453
}

0 commit comments

Comments
 (0)