Fix MacOS build

This commit is contained in:
Jacob Dufault 2017-10-31 15:43:07 -07:00
parent 7734943620
commit f48f818f4c

View File

@ -5,7 +5,6 @@
#include <loguru.hpp> #include <loguru.hpp>
#include <malloc.h>
#include <pthread.h> #include <pthread.h>
#include <cassert> #include <cassert>
#include <iostream> #include <iostream>
@ -39,6 +38,10 @@
#include <sys/prctl.h> #include <sys/prctl.h>
#endif #endif
#if defined(__linux__)
#include <malloc.h>
#endif
struct PlatformMutexLinux : public PlatformMutex { struct PlatformMutexLinux : public PlatformMutex {
sem_t* sem_ = nullptr; sem_t* sem_ = nullptr;
@ -259,7 +262,9 @@ std::vector<std::string> GetPlatformClangArguments() {
#undef CHECKED #undef CHECKED
void FreeUnusedMemory() { void FreeUnusedMemory() {
#if defined(__linux__)
malloc_trim(0); malloc_trim(0);
#endif
} }
#endif #endif