Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-112087: Make __sizeof__ and listiter_{len, next} to be threadsafe #114843

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 13 commits into from
Feb 14, 2024
Prev Previous commit
Address code review
  • Loading branch information
corona10 committed Feb 14, 2024
commit c8a8b81b413b5f8ba2ea2014582086a2c9be4c9a
5 changes: 1 addition & 4 deletions 5 Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2615,13 +2615,13 @@ dummy_func(
STAT_INC(FOR_ITER, hit);
PyListObject *seq = it->it_seq;
if ((size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq)) {
it->it_index = -1;
#ifndef Py_GIL_DISABLED
if (seq != NULL) {
it->it_seq = NULL;
Py_DECREF(seq);
}
#endif
it->it_index = -1;
Py_DECREF(iter);
STACK_SHRINK(1);
/* Jump forward oparg, then skip following END_FOR and POP_TOP instructions */
Expand All @@ -2635,9 +2635,6 @@ dummy_func(
_PyListIterObject *it = (_PyListIterObject *)iter;
assert(Py_TYPE(iter) == &PyListIter_Type);
PyListObject *seq = it->it_seq;
#ifndef Py_GIL_DISABLED
DEOPT_IF(seq == NULL);
#endif
DEOPT_IF((size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq));
}

Expand Down
3 changes: 0 additions & 3 deletions 3 Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2 Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.