Repository navigation
gh-158660: Allow calling frozenset methods without locking - #163017
Merged
Merged
Conversation
Add ASSERT_CAN_MODIFY_SET(), ASSERT_SET_LOCKED() and ASSERT_OTHER_LOCKED() helper functions to setobject.c to check if it's safe to use an object. For set objects, check that the critical section is locked. ASSERT_CAN_MODIFY_SET() and ASSERT_SET_LOCKED() do not require locking if the argument is a frozenset. ASSERT_OTHER_LOCKED() does not require locking if the argument is a frozenset or a frozendict. Move lock check from set_add_entry() to set_add_entry_takeref().
Call ASSERT_CAN_MODIFY_SET() in set_table_resize() and set_discard_entry().
Member
Author
|
Ah, there is yet another GitHub outage: Incident with Webhooks and Actions. I will re-run the CI later, once it will be solved. |
rhettinger
removed their request for review
December 2, 2026 20:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add ASSERT_CAN_MODIFY_SET(), ASSERT_SET_LOCKED() and ASSERT_OTHER_LOCKED() helper functions to setobject.c to check if it's safe to use an object. For set objects, check that the critical section is locked.
ASSERT_CAN_MODIFY_SET() and ASSERT_SET_LOCKED() do not require locking if the argument is a frozenset. ASSERT_OTHER_LOCKED() does not require locking if the argument is a frozenset or a frozendict.
Move lock check from set_add_entry() to set_add_entry_takeref().
PyListBuilderC API to solvePyList_SetItem()performance issue on the free-threaded build #158660