Index: include/__hash_table =================================================================== --- include/__hash_table +++ include/__hash_table @@ -20,7 +20,6 @@ #include #include <__undef_min_max> -#include <__undef___deallocate> #include <__debug> @@ -1321,7 +1320,7 @@ void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {} #endif // _LIBCPP_CXX03_LANG - void __deallocate(__next_pointer __np) _NOEXCEPT; + void __deallocate_node(__next_pointer __np) _NOEXCEPT; __next_pointer __detach() _NOEXCEPT; template friend class _LIBCPP_TEMPLATE_VIS unordered_map; @@ -1454,7 +1453,7 @@ "Predicate must be copy-constructible."); static_assert((is_copy_constructible::value), "Hasher must be copy-constructible."); - __deallocate(__p1_.first().__next_); + __deallocate_node(__p1_.first().__next_); #if _LIBCPP_DEBUG_LEVEL >= 2 __get_db()->__erase_c(this); #endif @@ -1492,7 +1491,7 @@ template void -__hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate(__next_pointer __np) +__hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate_node(__next_pointer __np) _NOEXCEPT { __node_allocator& __na = __node_alloc(); @@ -1599,11 +1598,11 @@ } catch (...) { - __deallocate(__cache); + __deallocate_node(__cache); throw; } #endif // _LIBCPP_NO_EXCEPTIONS - __deallocate(__cache); + __deallocate_node(__cache); } const_iterator __i = __u.begin(); while (__u.size() != 0) @@ -1661,11 +1660,11 @@ } catch (...) { - __deallocate(__cache); + __deallocate_node(__cache); throw; } #endif // _LIBCPP_NO_EXCEPTIONS - __deallocate(__cache); + __deallocate_node(__cache); } for (; __first != __last; ++__first) __insert_unique(*__first); @@ -1701,11 +1700,11 @@ } catch (...) { - __deallocate(__cache); + __deallocate_node(__cache); throw; } #endif // _LIBCPP_NO_EXCEPTIONS - __deallocate(__cache); + __deallocate_node(__cache); } for (; __first != __last; ++__first) __insert_multi(_NodeTypes::__get_value(*__first)); @@ -1765,7 +1764,7 @@ { if (size() > 0) { - __deallocate(__p1_.first().__next_); + __deallocate_node(__p1_.first().__next_); __p1_.first().__next_ = nullptr; size_type __bc = bucket_count(); for (size_type __i = 0; __i < __bc; ++__i) Index: include/__sso_allocator =================================================================== --- include/__sso_allocator +++ include/__sso_allocator @@ -15,8 +15,6 @@ #include #include -#include <__undef___deallocate> - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif @@ -64,7 +62,7 @@ if (__p == (pointer)&buf_) __allocated_ = false; else - _VSTD::__deallocate(__p); + _VSTD::__libcpp_deallocate(__p); } _LIBCPP_INLINE_VISIBILITY size_type max_size() const throw() {return size_type(~0) / sizeof(_Tp);} Index: include/__undef___deallocate =================================================================== --- include/__undef___deallocate +++ /dev/null @@ -1,20 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifdef __deallocate -#if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS) -#if defined(_MSC_VER) && !defined(__clang__) -_LIBCPP_WARNING("macro __deallocate is incompatible with C++. #undefining __deallocate") -#else -#warning: macro __deallocate is incompatible with C++. #undefining __deallocate -#endif -#endif -#undef __deallocate -#endif Index: include/experimental/dynarray =================================================================== --- include/experimental/dynarray +++ include/experimental/dynarray @@ -11,9 +11,6 @@ #ifndef _LIBCPP_DYNARRAY #define _LIBCPP_DYNARRAY -#include <__config> -#if _LIBCPP_STD_VER > 11 - /* dynarray synopsis @@ -96,6 +93,8 @@ }} // std::experimental */ +#include <__config> +#if _LIBCPP_STD_VER > 11 #include <__functional_base> #include @@ -104,8 +103,6 @@ #include #include -#include <__undef___deallocate> - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif @@ -143,9 +140,9 @@ return static_cast (_VSTD::__allocate (sizeof(value_type) * count)); } - static inline _LIBCPP_INLINE_VISIBILITY void __deallocate ( value_type* __ptr ) noexcept + static inline _LIBCPP_INLINE_VISIBILITY void __deallocate_value( value_type* __ptr ) noexcept { - _VSTD::__deallocate (static_cast (__ptr)); + _VSTD::__libcpp_deallocate (static_cast (__ptr)); } public: @@ -265,7 +262,7 @@ value_type *__data = data () + __size_; for ( size_t i = 0; i < __size_; ++i ) (--__data)->value_type::~value_type(); - __deallocate ( __base_ ); + __deallocate_value( __base_ ); } template Index: include/memory =================================================================== --- include/memory +++ include/memory @@ -644,7 +644,6 @@ #endif #include <__undef_min_max> -#include <__undef___deallocate> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -1772,7 +1771,7 @@ return static_cast(_VSTD::__allocate(__n * sizeof(_Tp))); } _LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type) _NOEXCEPT - {_VSTD::__deallocate((void*)__p);} + {_VSTD::__libcpp_deallocate((void*)__p);} _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT {return size_type(~0) / sizeof(_Tp);} #if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) @@ -1868,7 +1867,7 @@ return static_cast(_VSTD::__allocate(__n * sizeof(_Tp))); } _LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type) _NOEXCEPT - {_VSTD::__deallocate((void*)__p);} + {_VSTD::__libcpp_deallocate((void*)__p);} _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT {return size_type(~0) / sizeof(_Tp);} #if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) Index: include/module.modulemap =================================================================== --- include/module.modulemap +++ include/module.modulemap @@ -485,7 +485,6 @@ module __tree { header "__tree" export * } module __tuple { header "__tuple" export * } module __undef_min_max { header "__undef_min_max" export * } - module __undef___deallocate { header "__undef___deallocate" export * } module experimental { requires cplusplus11 Index: include/new =================================================================== --- include/new +++ include/new @@ -92,8 +92,6 @@ #include #endif -#include <__undef___deallocate> - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif @@ -217,7 +215,7 @@ #endif } -inline _LIBCPP_INLINE_VISIBILITY void __deallocate(void *__ptr) { +inline _LIBCPP_INLINE_VISIBILITY void __libcpp_deallocate(void *__ptr) { #ifdef _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE ::operator delete(__ptr); #else Index: include/valarray =================================================================== --- include/valarray +++ include/valarray @@ -348,7 +348,6 @@ #include #include <__undef_min_max> -#include <__undef___deallocate> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -3697,7 +3696,7 @@ { while (__end_ != __begin_) (--__end_)->~value_type(); - _VSTD::__deallocate(__begin_); + _VSTD::__libcpp_deallocate(__begin_); __begin_ = __end_ = nullptr; } if (__n) Index: src/experimental/memory_resource.cpp =================================================================== --- src/experimental/memory_resource.cpp +++ src/experimental/memory_resource.cpp @@ -34,7 +34,7 @@ { return __allocate(__size); } virtual void do_deallocate(void * __p, size_t, size_t) - { __deallocate(__p); } + { _VSTD::__libcpp_deallocate(__p); } virtual bool do_is_equal(memory_resource const & __other) const _NOEXCEPT { return &__other == this; }