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

Option to link against MIMALLOC statically #662

Closed
DubbleClick opened this issue Mar 19, 2025 · 1 comment · Fixed by #663
Closed

Option to link against MIMALLOC statically #662

DubbleClick opened this issue Mar 19, 2025 · 1 comment · Fixed by #663
Assignees
Labels
new feature New feature or request

Comments

@DubbleClick
Copy link
Collaborator

DubbleClick commented Mar 19, 2025

We should add libmimalloc and then in the end link mimalloc.o (yes .o) before all other libs.

The option should work with both musl and glibc.

Mimalloc is much faster than musl libc's allocator in threaded scenarios and even faster than glibc's allocator. While a glibc targeted build can easily load mimalloc with LD_PRELOAD, it would be more convenient to offer a static linking option for it.

cc @dunglas

@DubbleClick DubbleClick added the new feature New feature or request label Mar 19, 2025
@DubbleClick
Copy link
Collaborator Author

Note that Microsoft recommends going with LD_PRELOAD if possible.

I think this should only be used for musl-libc static builds as it will cause issues if an extension is loaded dynamically that did not link against mimalloc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant