Changeset - 8acda88ffe61
[Not reviewed]
0 3 0
Jan Kaluza - 13 years ago 2012-08-06 16:40:18
hanzz.k@gmail.com
Set MALLOC_CHECK_ using mallopt
3 files changed with 8 insertions and 5 deletions:
0 comments (0 inline, 0 general)
backends/libpurple/main.cpp
Show inline comments
 
@@ -1689,12 +1689,15 @@ int main(int argc, char **argv) {
 
#endif
 
		
 
#endif
 
	}
 
	else {
 
#ifndef WIN32
 
		mallopt(M_CHECK_ACTION, 2);
 
		mallopt(M_PERTURB, 0xb);
 

	
 
		signal(SIGPIPE, SIG_IGN);
 

	
 
		if (signal(SIGCHLD, spectrum_sigchld_handler) == SIG_ERR) {
 
			std::cout << "SIGCHLD handler can't be set\n";
 
			g_option_context_free(context);
 
			return -1;
spectrum/src/main.cpp
Show inline comments
 
@@ -23,12 +23,13 @@
 
#ifndef WIN32
 
#include "sys/signal.h"
 
#include <pwd.h>
 
#include <grp.h>
 
#include <sys/resource.h>
 
#include "libgen.h"
 
#include <malloc.h>
 
#else
 
#include <windows.h>
 
#endif
 
#include <sys/stat.h>
 

	
 
using namespace Transport;
 
@@ -122,14 +123,16 @@ int main(int argc, char **argv)
 
	boost::program_options::variables_map vm;
 
	bool no_daemon = false;
 
	std::string config_file;
 
	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) {
 
		std::cout << "SIGINT handler can't be set\n";
 
		return -1;
 
	}
spectrum_manager/src/main.cpp
Show inline comments
 
@@ -566,15 +566,12 @@ int main(int argc, char **argv)
 
 
	if (command.empty()) {
 
		std::cout << desc << "\n";
 
		return 1;
 
	}
 
 
	putenv("MALLOC_CHECK_=2");
 
	putenv("MALLOC_PERTURB_=B");
 
 
	if (command[0] == "start") {
 
		start_instances(&config);
 
	}
 
	else if (command[0] == "stop") {
 
		stop_instances(&config);
 
	}
0 comments (0 inline, 0 general)