[libcxx] r229281 - Implement C++14's sized deallocation functions, since there are no longer implicitly defined by clang, as of r229241.
Larisse Voufo
lvoufo at google.com
Sat Feb 14 21:18:55 PST 2015
Author: lvoufo
Date: Sat Feb 14 23:18:55 2015
New Revision: 229281
URL: http://llvm.org/viewvc/llvm-project?rev=229281&view=rev
Log:
Implement C++14's sized deallocation functions, since there are no longer implicitly defined by clang, as of r229241.
Modified:
libcxx/trunk/include/new
libcxx/trunk/src/new.cpp
Modified: libcxx/trunk/include/new
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/new?rev=229281&r1=229280&r2=229281&view=diff
==============================================================================
--- libcxx/trunk/include/new (original)
+++ libcxx/trunk/include/new Sat Feb 14 23:18:55 2015
@@ -50,12 +50,18 @@ new_handler get_new_handler() noexcept;
void* operator new(std::size_t size); // replaceable
void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable
void operator delete(void* ptr) noexcept; // replaceable
+void operator delete(void* ptr, std::size_t size) noexcept; // replaceable, C++14
void operator delete(void* ptr, const std::nothrow_t&) noexcept; // replaceable
+void operator delete(void* ptr, std::size_t size,
+ const std::nothrow_t&) noexcept; // replaceable, C++14
void* operator new[](std::size_t size); // replaceable
void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // replaceable
void operator delete[](void* ptr) noexcept; // replaceable
+void operator delete[](void* ptr, std::size_t size) noexcept; // replaceable, C++14
void operator delete[](void* ptr, const std::nothrow_t&) noexcept; // replaceable
+void operator delete[](void* ptr, std::size_t size,
+ const std::nothrow_t&) noexcept; // replaceable, C++14
void* operator new (std::size_t size, void* ptr) noexcept;
void* operator new[](std::size_t size, void* ptr) noexcept;
@@ -133,7 +139,9 @@ _LIBCPP_NEW_DELETE_VIS void* operator ne
;
_LIBCPP_NEW_DELETE_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
_LIBCPP_NEW_DELETE_VIS void operator delete(void* __p) _NOEXCEPT;
+_LIBCPP_NEW_DELETE_VIS void operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
_LIBCPP_NEW_DELETE_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
+_LIBCPP_NEW_DELETE_VIS void operator delete(void* __p, std::size_t __sz, const std::nothrow_t&) _NOEXCEPT;
_LIBCPP_NEW_DELETE_VIS void* operator new[](std::size_t __sz)
#if !__has_feature(cxx_noexcept)
@@ -142,7 +150,9 @@ _LIBCPP_NEW_DELETE_VIS void* operator ne
;
_LIBCPP_NEW_DELETE_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
_LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p) _NOEXCEPT;
+_LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p, std::size_t __sz) _NOEXCEPT;
_LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
+_LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p, std::size_t __sz, const std::nothrow_t&) _NOEXCEPT;
inline _LIBCPP_INLINE_VISIBILITY void* operator new (std::size_t, void* __p) _NOEXCEPT {return __p;}
inline _LIBCPP_INLINE_VISIBILITY void* operator new[](std::size_t, void* __p) _NOEXCEPT {return __p;}
Modified: libcxx/trunk/src/new.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/new.cpp?rev=229281&r1=229280&r2=229281&view=diff
==============================================================================
--- libcxx/trunk/src/new.cpp (original)
+++ libcxx/trunk/src/new.cpp Sat Feb 14 23:18:55 2015
@@ -126,6 +126,13 @@ operator delete(void* ptr) _NOEXCEPT
_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
void
+operator delete(void* ptr, size_t) _NOEXCEPT
+{
+ ::operator delete(ptr);
+}
+
+_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+void
operator delete(void* ptr, const std::nothrow_t&) _NOEXCEPT
{
::operator delete(ptr);
@@ -133,9 +140,23 @@ operator delete(void* ptr, const std::no
_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
void
+operator delete(void* ptr, size_t, const std::nothrow_t&) _NOEXCEPT
+{
+ ::operator delete(ptr);
+}
+
+_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+void
operator delete[] (void* ptr) _NOEXCEPT
{
- ::operator delete (ptr);
+ ::operator delete(ptr);
+}
+
+_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+void
+operator delete[] (void* ptr, size_t) _NOEXCEPT
+{
+ ::operator delete[](ptr);
}
_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
@@ -144,6 +165,13 @@ operator delete[] (void* ptr, const std:
{
::operator delete[](ptr);
}
+
+_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+void
+operator delete[] (void* ptr, size_t, const std::nothrow_t&) _NOEXCEPT
+{
+ ::operator delete[](ptr);
+}
#endif // !__GLIBCXX__
More information about the cfe-commits
mailing list