Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

Building libc++ with tbbmalloc

Marky__Marky
Beginner
520 Views

Hi,

I came up with project to create a libc++ library using tbbmalloc instead of default allocator on macOS, if I think right, it should result in a bit faster and saner memory-wise libc++. I'm not sure how to do that, I can imagine that linking tbbmalloc statically won't do that so I ask for help to achieve this.

Marky

0 Kudos
6 Replies
Vladimir_P_Intel2
520 Views

doesn't malloc replacement feature work for you?

Marky__Marky
Beginner
520 Views

Not saying it's not working, but DYLD_INSERT_LIBRARIES is skipped with SIP enabled on El Captain+ if I'm not missing something and I'm looking for a more system solution.

Vladimir_P_Intel2
520 Views

Hello, did you try to link with proxy to avoid env variable usage?

https://software.intel.com/en-us/articles/dynamic-allocator-replacement-on-os-x-with-intel-tbb

Vladimir 

Marky__Marky
Beginner
520 Views

Can you ask someone who knows more to respond to my 1st post? Libc++ doesn't have main() AFAIK. :)

Vladimir_P_Intel2
520 Views

hmm, why you are looking for main() function in libc++? the article says that you need to link your executable file with proxy. 

Vladimir

Alexey_K_Intel3
Employee
520 Views

Hi Marky,

Vladimir is right that replacing the memory manager for particular applications of interest (instead of the standard library) is generally a preferred approach.

If you nevertheless wish to make libc++ use tbbmalloc internally, perhaps you should first get some advice from the libc++ community about how to replace malloc with any other memory manager when building libc++.

Reply