Commit ed3e31d
committed
gh-155628: Use a relaxed add for the dict shared-keys incref
An INCREF_KEYS may only run while the caller already keeps the keys
alive: every dictkeys_incref call site holds either the dict's
per-object lock while dk is its ma_keys (which is also required to
replace ma_keys), or a strong reference chain such as the type's
cached keys. The increment therefore cannot race with the final
decref and needs no ordering. DECREF_KEYS is unchanged: the final
decref must order the keys' contents before freeing them.1 parent d7dd332 commit ed3e31d
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
234 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
235 | 237 | | |
236 | 238 | | |
237 | 239 | | |
| |||
0 commit comments