[cfe-commits] [libcxx] r159359 - in /libcxx/trunk/include: __config new

Nuno Lopes nunoplopes at sapo.pt
Thu Jun 28 09:47:34 PDT 2012


Author: nlopes
Date: Thu Jun 28 11:47:34 2012
New Revision: 159359

URL: http://llvm.org/viewvc/llvm-project?rev=159359&view=rev
Log:
mark operator new(std::nothrow) as noalias (aka __attribute__((malloc))

Modified:
    libcxx/trunk/include/__config
    libcxx/trunk/include/new

Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=159359&r1=159358&r2=159359&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Thu Jun 28 11:47:34 2012
@@ -391,6 +391,12 @@
 #define _LIBCPP_CONSTEXPR constexpr
 #endif
 
+#ifdef __GNUC__
+#define _NOALIAS __attribute__((malloc))
+#else
+#define _NOALIAS
+#endif
+
 #ifndef __has_feature
 #define __has_feature(__x) 0
 #endif

Modified: libcxx/trunk/include/new
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/new?rev=159359&r1=159358&r2=159359&view=diff
==============================================================================
--- libcxx/trunk/include/new (original)
+++ libcxx/trunk/include/new Thu Jun 28 11:47:34 2012
@@ -96,7 +96,7 @@
     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 @@
     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;
 





More information about the cfe-commits mailing list