Do not include malloc.h on BSD

This commit is contained in:
Jan Kaluza 2012-10-09 10:01:51 +02:00
parent ede2ffb4f8
commit c63df9499f
3 changed files with 8 additions and 0 deletions

View file

@ -19,7 +19,9 @@
#include "sys/wait.h"
#include "sys/signal.h"
// #include "valgrind/memcheck.h"
#ifndef __FreeBSD__
#include "malloc.h"
#endif
#include <dbus-1.0/dbus/dbus-glib-lowlevel.h>

View file

@ -14,8 +14,10 @@
#include "sys/signal.h"
#endif
#ifndef __FreeBSD__
// malloc_trim
#include "malloc.h"
#endif
// Boost
#include <boost/algorithm/string.hpp>
@ -106,8 +108,10 @@ class SwiftenPlugin : public NetworkPlugin {
}
#ifndef WIN32
#ifndef __FreeBSD__
// force returning of memory chunks allocated by libxml2 to kernel
malloc_trim(0);
#endif
#endif
}

View file

@ -26,7 +26,9 @@
#include <grp.h>
#include <sys/resource.h>
#include "libgen.h"
#ifndef __FreeBSD__
#include <malloc.h>
#endif
#else
#include <process.h>
#define getpid _getpid