diff options
Diffstat (limited to 'lib/Support/RWMutex.cpp')
-rw-r--r-- | lib/Support/RWMutex.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Support/RWMutex.cpp b/lib/Support/RWMutex.cpp index 83c6d1d52b4c..8b6d74e49f31 100644 --- a/lib/Support/RWMutex.cpp +++ b/lib/Support/RWMutex.cpp @@ -11,6 +11,7 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Support/Allocator.h" #include "llvm/Support/RWMutex.h" #include "llvm/Config/config.h" @@ -49,7 +50,7 @@ RWMutexImpl::RWMutexImpl() { // Declare the pthread_rwlock data structures pthread_rwlock_t* rwlock = - static_cast<pthread_rwlock_t*>(malloc(sizeof(pthread_rwlock_t))); + static_cast<pthread_rwlock_t*>(safe_malloc(sizeof(pthread_rwlock_t))); #ifdef __APPLE__ // Workaround a bug/mis-feature in Darwin's pthread_rwlock_init. @@ -116,9 +117,9 @@ RWMutexImpl::writer_release() #elif defined(LLVM_ON_UNIX) #include "Unix/RWMutex.inc" -#elif defined( LLVM_ON_WIN32) +#elif defined( _WIN32) #include "Windows/RWMutex.inc" #else -#warning Neither LLVM_ON_UNIX nor LLVM_ON_WIN32 was set in Support/Mutex.cpp +#warning Neither LLVM_ON_UNIX nor _WIN32 was set in Support/Mutex.cpp #endif #endif |