-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
Remove redundant decref from _PyLong_Negate #143050
Copy link
Copy link
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)release-blockertype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
In _PyLong_Negate there is a fast path for unique referenced longs. The slow path assumes the argument is a small int. We can add an assert for this condition, and remove the final decref (small ints are immortal).
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
- gh-143050: Remove redundant decref in _PyLong_Negate (gh-143051) #143051
- Revert "gh-143050: Remove redundant decref in _PyLong_Negate (gh-143051)" #145891
- gh-143050: correct PyLong_FromString() to use _PyLong_Negate() #145901
- [3.14] gh-143050: Correct PyLong_FromString() to use _PyLong_Negate() (GH-145901) #147331
- [3.13] gh-143050: Correct PyLong_FromString() to use _PyLong_Negate() (#145901) #147437
- gh-143050: add helper _PyLong_Init() #147956
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)release-blockertype-featureA feature request or enhancementA feature request or enhancement
Projects
Status
Done