gh-151722: Defer GC tracking in frozendict.copy() (#152230) · python/cpython@05679f3 · GitHub
Skip to content

Commit 05679f3

Browse files
authored
gh-151722: Defer GC tracking in frozendict.copy() (#152230)
Fix _PyDict_Or() and frozendict.copy(): only track the frozendict by the GC once the dictionary is fully initialized. Functions modifying frozendict now ensures that the object is not tracked by the GC (in debug mode). * can_modify_dict() checks that _PyObject_GC_IS_TRACKED() is false for frozendicts. * dict_merge_api() makes sure that the dictionary is tracked by the GC.
1 parent 72cad14 commit 05679f3

1 file changed

Lines changed: 72 additions & 37 deletions

File tree

Objects/dictobject.c

Lines changed: 72 additions & 37 deletions

0 commit comments

Comments
 (0)