-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
Allow to build Python without freelists #89685
Comments
Freelists are an optimization trick to avoid allocation and deallocation of commonly used structures. Currently Python has freelists for frame, tuple, float, list, dict, async generators, and context objects. Small ints are also cached. For experimentation with alternative memory allocators such as mimalloc, I would like to introduce a way to disable freelists. Tuples's _Py_tuple_state struct has a conditional check on #if PyTuple_MAXSAVESIZE > 0. I propose to add same logic to all other structs. |
I think we should revert this. It just makes working with freelists more cumbersome. Having more configure options just makes it more likely that we will fail to test some configuration. If you want to disable freelists in your experiments, feel free to do so, but it doesn't need to be in main, IMO. |
Which part of the patch is causing you extra work? Would you be fine if I only remove the configure option and leave the fixes for zero-length freelists (#define PyList_MAXFREELIST 0) in? |
Can you please document the new configuration option in https://docs.python.org/dev/using/configure.html ? When you write :option:`--without-freelists` in what's new in Python 3.11 to get a link ;-) |
I reopen the issue to not forget to complete the doc. |
I checked the docs, and this option is now documented; marking the issue as resolved. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: