Changeset - 79ff2e46d057
[Not reviewed]
0 2 0
Jan Kaluza - 13 years ago 2012-10-04 10:09:34
hanzz.k@gmail.com
Do not use malloc_trim on BSd
2 files changed with 8 insertions and 0 deletions:
0 comments (0 inline, 0 general)
backends/libpurple/main.cpp
Show inline comments
 
@@ -14,13 +14,15 @@
 
#include "transport/logging.h"
 
#include "transport/config.h"
 
#include "transport/logging.h"
 
#include "geventloop.h"
 

	
 
// #include "valgrind/memcheck.h"
 
#ifndef BSD
 
#include "malloc.h"
 
#endif
 
#include <algorithm>
 
#include "errno.h"
 
#include <boost/make_shared.hpp>
 

	
 
#ifdef WITH_LIBEVENT
 
#include <event.h>
 
@@ -361,14 +363,16 @@ class SpectrumNetworkPlugin : public NetworkPlugin {
 
				purple_account_set_enabled_wrapped(account, "spectrum", FALSE);
 

	
 
				m_accounts.erase(account);
 

	
 
				purple_accounts_delete_wrapped(account);
 
#ifndef WIN32
 
#ifndef BSD
 
				malloc_trim(0);
 
#endif
 
#endif
 
// 				VALGRIND_DO_LEAK_CHECK;
 
			}
 
		}
 

	
 
		void handleStatusChangeRequest(const std::string &user, int status, const std::string &statusMessage) {
 
			PurpleAccount *account = m_sessions[user];
src/usermanager.cpp
Show inline comments
 
@@ -28,13 +28,15 @@
 
#include "transport/logging.h"
 
#include "storageresponder.h"
 

	
 
#include "Swiften/Swiften.h"
 
#include "Swiften/Server/ServerStanzaChannel.h"
 
#include "Swiften/Elements/StreamError.h"
 
#ifndef BSD
 
#include "malloc.h"
 
#endif
 
// #include "valgrind/memcheck.h"
 

	
 
namespace Transport {
 

	
 
DEFINE_LOGGER(logger, "UserManager");
 

	
 
@@ -121,14 +123,16 @@ void UserManager::removeUser(User *user, bool onUserBehalf) {
 
		m_storageBackend->setUserOnline(user->getUserInfo().id, false);
 
	}
 

	
 
	onUserDestroyed(user);
 
	delete user;
 
#ifndef WIN32
 
#ifndef BSD
 
	malloc_trim(0);
 
#endif
 
#endif
 
// 	VALGRIND_DO_LEAK_CHECK;
 
}
 

	
 
void UserManager::removeAllUsers(bool onUserBehalf) {
 
	while(m_users.begin() != m_users.end()) {
 
		removeUser((*m_users.begin()).second, onUserBehalf);
0 comments (0 inline, 0 general)