Commit 28495f2
committed
gh-155628: Use relaxed adds for the GC allocation counter
The free-threaded build buffers per-thread allocation counts and
flushes them to gcstate->young.count in three places: when the local
threshold is reached, when a thread state is cleared, and in
gc.get_count(). The counter is a collection heuristic: its readers use
relaxed loads (gc_should_collect()) or a compare-exchange loop, it is
reset during a stop-the-world pause, and it publishes no other memory,
so the flushes need atomicity but no ordering.1 parent 1bd9bcd commit 28495f2
3 files changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2025 | 2025 | | |
2026 | 2026 | | |
2027 | 2027 | | |
2028 | | - | |
| 2028 | + | |
2029 | 2029 | | |
2030 | 2030 | | |
2031 | 2031 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1879 | 1879 | | |
1880 | 1880 | | |
1881 | 1881 | | |
1882 | | - | |
1883 | | - | |
| 1882 | + | |
| 1883 | + | |
1884 | 1884 | | |
1885 | 1885 | | |
1886 | 1886 | | |
| |||
0 commit comments