Set MALLOC_CHECK_ using mallopt

This commit is contained in:
Jan Kaluza 2012-08-06 16:40:18 +02:00
parent d4f1634456
commit 8acda88ffe
3 changed files with 8 additions and 5 deletions

View file

@ -1692,6 +1692,9 @@ int main(int argc, char **argv) {
}
else {
#ifndef WIN32
mallopt(M_CHECK_ACTION, 2);
mallopt(M_PERTURB, 0xb);
signal(SIGPIPE, SIG_IGN);
if (signal(SIGCHLD, spectrum_sigchld_handler) == SIG_ERR) {

View file

@ -26,6 +26,7 @@
#include <grp.h>
#include <sys/resource.h>
#include "libgen.h"
#include <malloc.h>
#else
#include <windows.h>
#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) {

View file

@ -569,9 +569,6 @@ int main(int argc, char **argv)
return 1;
}
putenv("MALLOC_CHECK_=2");
putenv("MALLOC_PERTURB_=B");
if (command[0] == "start") {
start_instances(&config);
}