diff options
author | T. Wouters <thomas@python.org> | 2025-03-12 15:21:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-12 15:21:46 (GMT) |
commit | de2f7da77d9e8dc6758430249e7179d37b3fee44 (patch) | |
tree | 13a20c58828b74a4851373476635382fc4aba797 /Python/optimizer.c | |
parent | db27aee2fe253855fc57b118658f4f4718819382 (diff) | |
download | cpython-de2f7da77d9e8dc6758430249e7179d37b3fee44.zip cpython-de2f7da77d9e8dc6758430249e7179d37b3fee44.tar.gz cpython-de2f7da77d9e8dc6758430249e7179d37b3fee44.tar.bz2 |
gh-115999: Add free-threaded specialization for FOR_ITER (#128798)
Add free-threaded versions of existing specialization for FOR_ITER (list, tuples, fast range iterators and generators), without significantly affecting their thread-safety. (Iterating over shared lists/tuples/ranges should be fine like before. Reusing iterators between threads is not fine, like before. Sharing generators between threads is a recipe for significant crashes, like before.)
Diffstat (limited to 'Python/optimizer.c')
-rw-r--r-- | Python/optimizer.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/optimizer.c b/Python/optimizer.c index e055234..6fc5eab 100644 --- a/Python/optimizer.c +++ b/Python/optimizer.c @@ -363,6 +363,7 @@ _PyUOp_Replacements[MAX_UOP_ID + 1] = { [_ITER_JUMP_LIST] = _GUARD_NOT_EXHAUSTED_LIST, [_ITER_JUMP_TUPLE] = _GUARD_NOT_EXHAUSTED_TUPLE, [_FOR_ITER] = _FOR_ITER_TIER_TWO, + [_ITER_NEXT_LIST] = _ITER_NEXT_LIST_TIER_TWO, }; static const uint8_t |