You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor the test so that the specialized and unspecialized implementation of loading
the argument to sys.getrefcount use the same refcounting approach. Previously, the
argument would be evaluated by loading an attribute from a module. This specializes
to LOAD_ATTR_MODULE. In free-threaded builds the unspecialized form of LOAD_ATTR
always creates a new reference for its result, while the specialized form does not
create a reference if the result uses deferred refcounting. This causes a difference
in the result returned from sys.getrefcount, depending on whether or not the bytecode
has been specialized (e.g. on runs > 1 in refleak tests).
The refactored version uses LOAD_GLOBAL, whose specialized and unspecialized forms both
do not create references when the result uses deferred refcounting.
Also refactor the test to handle the difference in the result returned from sys.getrefcount
in default builds (includes the temporary reference on the operand stack) and free-threaded
builds (no temporary reference is created for deferred values).
0 commit comments