Skip to content

[mypyc] Borrow even more things #12817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 23, 2022
Merged

[mypyc] Borrow even more things #12817

merged 10 commits into from
May 23, 2022

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented May 19, 2022

Borrow operands of tagged integer operations to reduce the number of
incref/decref operations (when it's safe to do so).

Borrow the results in list get item operations, similar to what we've been
doing with get attribute operations.

@97littleleaf11 97littleleaf11 self-requested a review May 20, 2022 02:24
Borrowing means keeping a reference without incrementing the reference count.
"""
if isinstance(expr, (IntExpr, FloatExpr, StrExpr, BytesExpr)):
# Literals are immportal and can always be borrowed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo?

@JukkaL JukkaL merged commit 3c04092 into master May 23, 2022
@JukkaL JukkaL deleted the mypyc-refcount-more branch May 23, 2022 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants