diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2012-06-28 16:47:34 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2012-06-28 16:47:34 +0000 |
commit | 6317bfb26acde133c5d7f7074a0efcb972972280 (patch) | |
tree | a2703752e2a0865e6601a1913ff34ee83c746324 /libcxx/include | |
parent | ee3d99f6be597364fedad2006c71e62e0baaed6b (diff) | |
download | bcm5719-llvm-6317bfb26acde133c5d7f7074a0efcb972972280.tar.gz bcm5719-llvm-6317bfb26acde133c5d7f7074a0efcb972972280.zip |
mark operator new(std::nothrow) as noalias (aka __attribute__((malloc))
llvm-svn: 159359
Diffstat (limited to 'libcxx/include')
-rw-r--r-- | libcxx/include/__config | 6 | ||||
-rw-r--r-- | libcxx/include/new | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config index 369417c4ee4..3df583fdbdc 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -391,6 +391,12 @@ template <unsigned> struct __static_assert_check {}; #define _LIBCPP_CONSTEXPR constexpr #endif +#ifdef __GNUC__ +#define _NOALIAS __attribute__((malloc)) +#else +#define _NOALIAS +#endif + #ifndef __has_feature #define __has_feature(__x) 0 #endif diff --git a/libcxx/include/new b/libcxx/include/new index 5bcbad0cd04..ae0951a7485 100644 --- a/libcxx/include/new +++ b/libcxx/include/new @@ -96,7 +96,7 @@ _LIBCPP_VISIBLE void* operator new(std::size_t __sz) throw(std::bad_alloc) #endif ; -_LIBCPP_VISIBLE void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT; +_LIBCPP_VISIBLE void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS; _LIBCPP_VISIBLE void operator delete(void* __p) _NOEXCEPT; _LIBCPP_VISIBLE void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT; @@ -105,7 +105,7 @@ _LIBCPP_VISIBLE void* operator new[](std::size_t __sz) throw(std::bad_alloc) #endif ; -_LIBCPP_VISIBLE void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT; +_LIBCPP_VISIBLE void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS; _LIBCPP_VISIBLE void operator delete[](void* __p) _NOEXCEPT; _LIBCPP_VISIBLE void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT; |