Skip to content
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

gh-116984: Install mimalloc headers #116985

Merged
merged 6 commits into from Apr 23, 2024

Conversation

oraluben
Copy link
Contributor

@oraluben oraluben commented Mar 19, 2024

This PR installs mimalloc headers and allow extensions that access pycore_*.h continue working.

Such extensions need to explicitly add internal/mimalloc to its header search path.

Copy link
Contributor

@colesbury colesbury left a comment

Choose a reason for hiding this comment

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

I think we should only install the headers if Python is built with mimalloc (i.e., not configured with --without-mimalloc).

@oraluben oraluben force-pushed the add-mimalloc-header branch 4 times, most recently from 3d63aa4 to a969e35 Compare March 20, 2024 02:22
configure.ac Outdated Show resolved Hide resolved
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Copy link
Contributor

@colesbury colesbury left a comment

Choose a reason for hiding this comment

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

This looks good to me, but I'll wait for other people to leave their feedback.

As written in the devguide, for users, the internal API is sometimes "the best workaround for a thorny problem", so we want it to compile successfully in an Python installation.

At the same time, we don't always prefix names with Py or _Py in the internal API, so including CPython internal headers can lead to language level name conflicts. In this case, if an extensions includes our internal headers and bundles mimalloc, they could run into problems. While not ideal, I don't think that's a reason not to make the internal headers compile at all in installations.

@oraluben
Copy link
Contributor Author

Hi @vstinner , would you like to help landing this?

@erlend-aasland erlend-aasland merged commit e17cd1f into python:main Apr 23, 2024
34 checks passed
@erlend-aasland
Copy link
Contributor

Thanks @oraluben and @colesbury!

@oraluben oraluben deleted the add-mimalloc-header branch April 23, 2024 08:00
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.

None yet

3 participants