0

I want to use jemalloc on windows as like tcmalloc. In tcmalloc I just need to include the tcmalloc header in source and link with tcmalloc_minimal.lib and Force include __tcmalloc symbol in linker option. All malloc and free calls are replaced by tcmalloc implementation.

But in jemalloc all functions have je_ prefix and it does not replace CRT malloc/free etc with jemalloc functions.

How can I achieve this?

Billal Begueradj
  • 20,717
  • 43
  • 112
  • 130
david
  • 321
  • 3
  • 12
  • You should check your build environment, from the docs: _"By default, the prefix is "", except on OS X, where it is "je__ "."_ here: https://github.com/jemalloc/jemalloc/blob/dev/INSTALL.md – Richard Critten Jan 17 '18 at 12:14
  • Don't use malloc in any flavor in C++. –  Jan 17 '18 at 12:19
  • Thanks for the suggestions. I looked at the code for tcmalloc and they patch the malloc etc (CRT ) functions with their implementation. So any call to malloc/free/new etc from any DLLs loaded by process would use tcmalloc implementation. But jemalloc lacks this patching functionality. – david Jan 17 '18 at 14:38
  • https://stackoverflow.com/q/858592/505088 – David Heffernan Jan 18 '18 at 05:49

0 Answers0