disable new/delete overrides when building as C code#959
disable new/delete overrides when building as C code#959Noxybot wants to merge 1 commit intomicrosoft:devfrom
Conversation
apparently, even if MI_USE_CXX is OFF, mimalloc still provides mangled definitions of new/delete operators. It causes inability to statically link mimaloc in our scenario, since we want to have our own overrides of new/delete functions.
|
Uh, but wouldn't this change disable C++ new/delete overrides entirely when not compiling as C++? The way In other words: disabling the C++ overrides probably warrants a separate build option/preprocessor macro to check. |
Yes. But it was my anticipation from an option called MI_USE_CXX being set to OFF. Why would we ever want to override global new/delete in C only code? It's C-only code, so those new/delete are not from C standard library. |
|
Bit tricky... if you don't want to override malloc/free/new/delete it is best to cmake with |
|
when exist projects redefine new/delete and static link, |
apparently, even if MI_USE_CXX is OFF, mimalloc still provides mangled definitions of new/delete operators. It causes inability to statically link mimaloc in our scenario, since we want to have our own overrides of new/delete functions.