diff --git a/backends/libpurple/main.cpp b/backends/libpurple/main.cpp index 0a487ea33cd68a5d846ebed5236a5ea43293849f..1c3f8c4850fb089284e030f4b345b405861f22e4 100644 --- a/backends/libpurple/main.cpp +++ b/backends/libpurple/main.cpp @@ -17,7 +17,9 @@ #include "geventloop.h" // #include "valgrind/memcheck.h" +#ifndef __FreeBSD__ #include "malloc.h" +#endif #include #include "errno.h" #include @@ -364,8 +366,10 @@ class SpectrumNetworkPlugin : public NetworkPlugin { purple_accounts_delete_wrapped(account); #ifndef WIN32 +#ifndef __FreeBSD__ malloc_trim(0); #endif +#endif // VALGRIND_DO_LEAK_CHECK; } } @@ -1459,8 +1463,10 @@ static void signed_on(PurpleConnection *gc, gpointer unused) { PurpleAccount *account = purple_connection_get_account_wrapped(gc); np->handleConnected(np->m_accounts[account]); #ifndef WIN32 +#ifndef __FreeBSD__ // force returning of memory chunks allocated by libxml2 to kernel malloc_trim(0); +#endif #endif // For prpl-gg @@ -1648,8 +1654,10 @@ static void transportDataReceived(gpointer data, gint source, PurpleInputConditi int main(int argc, char **argv) { #ifndef WIN32 +#ifndef __FreeBSD__ mallopt(M_CHECK_ACTION, 2); mallopt(M_PERTURB, 0xb); +#endif signal(SIGPIPE, SIG_IGN);