diff --git a/spectrum/src/main.cpp b/spectrum/src/main.cpp index 1665969a81a1cdeab0b2b2fe3577a3e771896a3a..bc35e2e2b799682fb8a44d8355d5d4a84a287814 100644 --- a/spectrum/src/main.cpp +++ b/spectrum/src/main.cpp @@ -26,6 +26,7 @@ #include #include #include "libgen.h" +#include #else #include #endif @@ -125,8 +126,10 @@ int main(int argc, char **argv) std::string jid; setlocale(LC_ALL, ""); - putenv("MALLOC_CHECK_=2"); - putenv("MALLOC_PERTURB_=B"); +#ifndef WIN32 + mallopt(M_CHECK_ACTION, 2); + mallopt(M_PERTURB, 0xb); +#endif #ifndef WIN32 if (signal(SIGINT, spectrum_sigint_handler) == SIG_ERR) {