-
Notifications
You must be signed in to change notification settings - Fork 106
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
sn_malloc not called? #480
Comments
Maybe a detailed starter tutorial, or an example will help. I also tried "Using snmalloc as header-only library", no luck either. |
Hi, thanks for trying snmalloc! This is expected behaviour. If you just build snmalloc, then you will get a |
@zhmt from your comment it looks like you are on Windows. I think you want the static library for your use case. If you set CMAKE with:
This should build a static library that you can link that exposes the names
which will appear in the relevant build directory as
The order of includes is fragile for getting the correct overriding behaviour on Windows. I think the static lib has to appear first in the include order. We'll try to get an example and add it to the docs. You can also experiment with the static library with a non-empty prefix, and this will get you symbols like |
I am trying snmalloc on windows. It is a little bit tricky on windows. |
"opertor new " of snmalloc works now, I have to pass buffers from threads to threads over queue, if malloc can also be hooked, that would be nice. |
snmalloc fits my situation very well. Lots of messages and buffers are passed bettween threads, so jemalloc and mimalloc are not working perfectly. I count on snmalloc. |
I dump the snmallocshim-static.lib, function malloc is not exported. |
Here is the exported functions:
|
The prefixing is controlled by the |
Not sufficient . I made the malloc exported, it still doesn't work.
A tool like mimalloc-redirect.dll is needed. |
Thanks for you guys' help. |
So Emery Berger's heap layers has a library for redirecting allocators on Windows: This looks like we might be able to use this with snmalloc. I don't have capacity to do this myself, but I am happy to review if someone can get it working. |
I built snmalloc, and linked it to my app.exe, and try to "auto ptr = malloc(4);", but sn_malloc not called?
What have I missed?
The text was updated successfully, but these errors were encountered: