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
1,284 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_1234567890
1,284 Views

doesn't malloc replacement feature work for you?

0 Kudos
Marky__Marky
Beginner
1,284 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.

0 Kudos
Vladimir_P_1234567890
1,284 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 

0 Kudos
Marky__Marky
Beginner
1,284 Views

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

0 Kudos
Vladimir_P_1234567890
1,284 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

0 Kudos
Alexey-Kukanov
Employee
1,284 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++.

0 Kudos
Reply