purpleprotocol / mimalloc_rust

A Rust wrapper over Microsoft's MiMalloc memory allocator
MIT License
481 stars 42 forks source link

add an environment variable for dynamic linking #77

Open happysalada opened 2 years ago

happysalada commented 2 years ago

Hi, could we add an environment variable for dynamic linking? Something that like CARGO_MIMALLOC_DYNAMIC_LINKING that would do something akin to https://github.com/fede1024/rust-rdkafka/blob/master/rdkafka-sys/build.rs#L41 (finding the lib with pkg-config). There might be a version mismatch, but there are several advantages.

to give you a bit more context, I've tried to package something recently in rust that had a dependency on mimalloc_rust and had to give up (because compiling mimalloc has some dependencies not included when compiling for darwin).

jianshu93 commented 1 year ago

I have the same issue here, for MacOS Darwin, static link is always very hard while dynamic link is preferred. I would love to see it working on MacOS.

Thanks, Jianshu