-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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-90815: Add mimalloc memory allocator #31164
Conversation
🤖 New build scheduled with the buildbot fleet by @tiran for commit d4d545e5d54cced48793a1e67d36553588d4c560 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
d4d545e
to
d6f5f01
Compare
🤖 New build scheduled with the buildbot fleet by @tiran for commit 973b6178c0b46c2cd839b06cbe543ea039962442 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
🤖 New build scheduled with the buildbot fleet by @tiran for commit 9b8d0dac0c8ca184f0d7a93ee4b880edcacf64fd 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
🤖 New build scheduled with the buildbot fleet by @tiran for commit a9c29e66902900022bd74357647d0cc8c1538292 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
🤖 New build scheduled with the buildbot fleet by @tiran for commit e7231f186360d756df7d1320e39433fb46077e99 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
🤖 New build scheduled with the buildbot fleet by @tiran for commit 2472ecbf4e4723186145d3476dcbee7ef95cb8a4 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
🤖 New build scheduled with the buildbot fleet by @tiran for commit 10498c3826865ac62811be3a61db019b01f23fc8 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
JFYI on Windows,
|
210b5db
to
60d6011
Compare
01a3321
to
42c681a
Compare
f56577e
to
65af44c
Compare
I have rebased the PR again. |
Thanks! |
Hi, just want to check if this is still under development? |
tiran is currently taking a break, so it's not being actively developed. I think we're still interested in using mimalloc though? Probably @ericsnowcurrently is the best person to sync with. |
... or @colesbury. |
FWIW, I don't have much relationship with this effort currently. At one point I thought I needed it for per-interpreter GIL, but realized later I didn't. That said, I would like to see this happen as I think it opens up several valuable opportunities to us. Furthermore, I did work with @daanx, the creator of mimalloc, to address the remaining issues, so this PR should be mostly ready, aside from conflicts and pulling in the latest mimalloc. Ultimately, this change will probably need a PEP. (I also don't know what our options are regarding linking mimalloc in rather than vendoring it.) Other than that, I don't have much insight to offer, sadly. |
Hi, @daanx here from mimalloc -- let me know if I can help with this PR. Just wanted to add that it would be good to merge the latest version of mimalloc as recently I made many improvements in particular for Valgrind and ASAN (and ETW) tools. |
* Add mimalloc v2.12 Modified src/alloc.c to remove include of alloc-override.c and not compile new handler. Did not include the following files: - include/mimalloc-new-delete.h - include/mimalloc-override.h - src/alloc-override-osx.c - src/alloc-override.c - src/static.c - src/region.c mimalloc is thread safe and shares a single heap across all runtimes, therefore finalization and getting global allocated blocks across all runtimes is different. * mimalloc: minimal changes for use in Python: - remove debug spam for freeing large allocations - use same bytes (0xDD) for freed allocations in CPython and mimalloc This is important for the test_capi debug memory tests * Don't export mimalloc symbol in libpython. * Enable mimalloc as Python allocator option. * Add mimalloc MIT license. * Log mimalloc in Lib/test/pythoninfo.py. * Document new mimalloc support. * Use macro defs for exports as done in: #31164 Co-authored-by: Sam Gross <colesbury@gmail.com> Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
Superseded by #109914. |
* Add mimalloc v2.12 Modified src/alloc.c to remove include of alloc-override.c and not compile new handler. Did not include the following files: - include/mimalloc-new-delete.h - include/mimalloc-override.h - src/alloc-override-osx.c - src/alloc-override.c - src/static.c - src/region.c mimalloc is thread safe and shares a single heap across all runtimes, therefore finalization and getting global allocated blocks across all runtimes is different. * mimalloc: minimal changes for use in Python: - remove debug spam for freeing large allocations - use same bytes (0xDD) for freed allocations in CPython and mimalloc This is important for the test_capi debug memory tests * Don't export mimalloc symbol in libpython. * Enable mimalloc as Python allocator option. * Add mimalloc MIT license. * Log mimalloc in Lib/test/pythoninfo.py. * Document new mimalloc support. * Use macro defs for exports as done in: python#31164 Co-authored-by: Sam Gross <colesbury@gmail.com> Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* Add mimalloc v2.12 Modified src/alloc.c to remove include of alloc-override.c and not compile new handler. Did not include the following files: - include/mimalloc-new-delete.h - include/mimalloc-override.h - src/alloc-override-osx.c - src/alloc-override.c - src/static.c - src/region.c mimalloc is thread safe and shares a single heap across all runtimes, therefore finalization and getting global allocated blocks across all runtimes is different. * mimalloc: minimal changes for use in Python: - remove debug spam for freeing large allocations - use same bytes (0xDD) for freed allocations in CPython and mimalloc This is important for the test_capi debug memory tests * Don't export mimalloc symbol in libpython. * Enable mimalloc as Python allocator option. * Add mimalloc MIT license. * Log mimalloc in Lib/test/pythoninfo.py. * Document new mimalloc support. * Use macro defs for exports as done in: python#31164 Co-authored-by: Sam Gross <colesbury@gmail.com> Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* Add mimalloc v2.12 Modified src/alloc.c to remove include of alloc-override.c and not compile new handler. Did not include the following files: - include/mimalloc-new-delete.h - include/mimalloc-override.h - src/alloc-override-osx.c - src/alloc-override.c - src/static.c - src/region.c mimalloc is thread safe and shares a single heap across all runtimes, therefore finalization and getting global allocated blocks across all runtimes is different. * mimalloc: minimal changes for use in Python: - remove debug spam for freeing large allocations - use same bytes (0xDD) for freed allocations in CPython and mimalloc This is important for the test_capi debug memory tests * Don't export mimalloc symbol in libpython. * Enable mimalloc as Python allocator option. * Add mimalloc MIT license. * Log mimalloc in Lib/test/pythoninfo.py. * Document new mimalloc support. * Use macro defs for exports as done in: python#31164 Co-authored-by: Sam Gross <colesbury@gmail.com> Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
https://bugs.python.org/issue46657
gh-90815