I don’t know how you use it under Windows, and I’m not familiar with VS, but the principle should apply. If you still use gcc/mingw, you can directly link the jemalloc library first and then globally replace it with the implementation using jemalloc. Here is an example: cc app.c -o app -L${JEMALLOC_PATH}/lib -Wl,-rpath,${JEMALLOC_PATH}/lib -ljemalloc From the documentation: https ://github.com/jemalloc/j... In Linux, you can also directly add the compiled jemalloc library path to LD_LIBRARY_PATH
This is a common use of dependency injection during connection. You can try to answer where the original malloc function came from, and how is it connected to the current program?
I don’t know how you use it under Windows, and I’m not familiar with VS, but the principle should apply.
If you still use gcc/mingw, you can directly link the jemalloc library first and then globally replace it with the implementation using jemalloc.
Here is an example:
cc app.c -o app -L${JEMALLOC_PATH}/lib -Wl,-rpath,${JEMALLOC_PATH}/lib -ljemalloc
From the documentation:
https ://github.com/jemalloc/j...
In Linux, you can also directly add the compiled jemalloc library path to LD_LIBRARY_PATH
This is a common use of dependency injection during connection.
You can try to answer where the original malloc function came from, and how is it connected to the current program?