Unable to intercept the dll
According to the requirements of the document "Dynamic Override on Windows", I have checked and found that everything is in compliance. However, I still cannot intercept the dll files. I can only intercept them in the main program. How should I troubleshoot this?
Is it necessary to use #include "mimalloc-overriding.h" separately for all DLLS and link the related DLLS
DIfficult to say what is wrong:
- make sure you did follow all instructions -- is
mimalloc-redirect.dllin the same directory as the executable? - run with
MIMALLOC_VERBOSE=1in the environment to see verbose output and check if at startup you see that "mimalloc is redirected" - run
minject -l <myexe>to see ifmimalloc.dllis linked early in the import list
DIfficult to say what is wrong:
- make sure you did follow all instructions -- is in the same directory as the executable?
mimalloc-redirect.dll- run with in the environment to see verbose output and check if at startup you see that "mimalloc is redirected"
MIMALLOC_VERBOSE=1- run to see if is linked early in the import list
minject -l <myexe>``mimalloc.dll
It has been set as required. So how can I determine which DLLs this program relies on and that they are all allocated through mimalloc? The information I obtained through mi_stats_print is as follows. Can this prove that the called DLL is already using mimalloc?
Hello, after searching for information over the past two days, I seem to have understood how to use mimalloc.
Based on your descriptions in #535, #258, and #624, my understanding is as follows:
On Windows, since each DLL/EXE (module) has its own namespace, for C++, you should include #include <mimalloc-new-delete.h> once in a single .cpp file of each module to replace the default new/delete implementations for better performance. However, even if you don’t include mimalloc-new-delete.h, the basic malloc/free interception and replacement is achieved via mimalloc-redirect.dll, so mimalloc’s malloc/free will still be used. On Unix systems, enabling MI_OVERRIDE=ON when compiling mimalloc is sufficient, and there is no need to include #include <mimalloc-new-delete.h>.
To verify if mimalloc is in use, run the command: set MIMALLOC_VERBOSE=1 in CMD, then execute the program in CMD. If the message "mimalloc is redirected" appears, it indicates successful activation.
Thanks. I hope it is working now for you?
Thanks. I hope it is working now for you?
Thank you. He has resumed normal work now.