-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Integrate mimalloc allocator #99686
base: master
Are you sure you want to change the base?
Integrate mimalloc allocator #99686
Conversation
8bd1a51
to
43f1217
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conceptually, I like the low-level approach a lot more. It'd be great if you could provide some performance metrics once you feel the PR is in a presentable state!
mimalloc/windows_override.cpp
Outdated
#if 0 // This one doesn't work. | ||
__declspec(restrict) unsigned short *wcsdup(const unsigned short *s) { | ||
return mi_wcsdup(s); | ||
} | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any further context for why this one doesn't work, and how relevant it is compared to the rest of the functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error C2733: 'wcsdup': you cannot overload a function with 'extern "C"' linkage
I've rewritten this file and now it's more "traceable" and contains remarks.
3b6d52a
to
29e9a4f
Compare
d2c537d
to
d1833e1
Compare
d1833e1
to
bb886cc
Compare
If it helps somehow, I tried an approach of mimalloc a while ago: DeeJayLSP@eae9709 However, getting it to work properly was beyond my knowledge. I observed there is a One thing that I did manage to do however, was linking with the system-provided mimalloc for Linux packages using |
I noticed #99427, an integration of mimalloc.
Since I already had an integration in a private fork, I've decided to upstream it so we can decide which one is the preferred way.
Main highlight is that this is a low-level integration: as such it also hooks into allocations made by 3rd-party code (TLS storage, C/C++ standard library containers, 3rd-party libraries, etc.).
Disclaimer:
This has been thoroughly tested downstream on Windows and certain non-standard platforms. This PR would need some work to add the low-level integration to all the other platforms. On Mac it may work out-of-the-box, though.
2024-11-26:
malloc()
and friends.2024-11-26 (2):