8000 gh-126703: Add freelists for iterators and range, method and builtin_function_or_method objects by eendebakpt · Pull Request #128368 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-126703: Add freelists for iterators and range, method and builtin_function_or_method objects #128368

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 11 commits into from
Prev Previous commit
Next Next commit
clear freelists
  • Loading branch information
eendebakpt committed Jan 1, 2025
commit 64be6c4ac1e02ca28029816d4f2fc2ee7d36318f
3 changes: 3 additions & 0 deletions Objects/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,9 @@ _PyObject_ClearFreeLists(struct _Py_freelists *freelists, int is_finalization)
}
clear_freelist(&freelists->unicode_writers, is_finalization, PyMem_Free);
clear_freelist(&freelists->ints, is_finalization, free_object);
clear_freelist(&freelists->shared_iters, is_finalization, free_object);
clear_freelist(&freelists->ranges, is_finalization, free_object);
clear_freelist(&freelists->class_method, is_finalization, free_object);
}

/*
Expand Down
1 change: 1 addition & 0 deletions Objects/rangeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,7 @@ fast_range_iter(long start, long stop, long step, long len)
}
else {
Py_SET_TYPE(it, &PyRangeIter_Type);
//_PyObject_GC_TRACK(it); // need to track with GC again
}
it->start = start;
it->step = step;
Expand Down
Loading
0