Skip to content

bpo-38879: Reordered error checking in PyArena_New(). #16587

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

Closed
wants to merge 1 commit into from
Closed

bpo-38879: Reordered error checking in PyArena_New(). #16587

wants to merge 1 commit into from

Conversation

Zotyamester
Copy link

@Zotyamester Zotyamester commented Oct 4, 2019

Put "arena->a_cur = arena->a_head;" after the error checking of "arena->a_objects = PyList_New(0);". It's more optimal, even if it can't be measured.

https://bugs.python.org/issue38879

https://bugs.python.org/issue38879

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@Zotyamester

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@csabella
Copy link
Contributor

Hello @Zotyamester, please open an issue on the bug tracker for your suggestion. Thank you!

@csabella
Copy link
Contributor

csabella commented Dec 1, 2019

@Zotyamester, I'm closing this for now. If you are interested in creating a ticket on the bug tracker, then this can be re-opened at that time. Thank you.

@csabella csabella closed this Dec 1, 2019
@Zotyamester
Copy link
Author

Zotyamester commented Dec 1, 2019

@csabella Sorry but I don't understand your problem. I opened an issue on the bugtracker when you told me. What is the problem?

@csabella csabella reopened this Dec 2, 2019
@csabella csabella changed the title Reordered error checking in PyArena_New(). bpo-38879: Reordered error checking in PyArena_New(). Dec 2, 2019
@csabella
Copy link
Contributor

csabella commented Dec 2, 2019

@Zotyamester, sorry for that - I didn't see the bpo number. I've updated the PR title to reflect the ticket number and I've reopened the PR. Thank you!

@pitrou
Copy link
Member

pitrou commented Dec 15, 2019

I don't think I understand the point of this change. This is saving one CPU instruction (perhaps one nanosecond) in the unlikely case of a memory error. @vstinner What do you think?

@Zotyamester
Copy link
Author

@pitrou
Yes, I know that's not too much, but still something and it also makes the code a bit more organized.

@pitrou
Copy link
Member

pitrou commented Jan 1, 2020

Sorry, I'm going to refuse this change. This is useless churn, and may complicate maintenance when backporting bugfixes. More constructive changes are still welcome, of course.

@pitrou pitrou closed this Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants