head 1.1; branch 1.1.1; access; symbols perseant-exfatfs-base-20261102:1.1.1.10 netbsd-11-1-RELEASE:1.1.1.9 gcc-14-4-0:1.1.1.10 netbsd-10-2-RELEASE:1.1.1.8 netbsd-9-5-RELEASE:1.1.1.3 netbsd-11-0-RELEASE:1.1.1.9 netbsd-11-0-RC7:1.1.1.9 netbsd-11-0-RC6:1.1.1.9 netbsd-11-0-RC5:1.1.1.9 netbsd-11-0-RC4:1.1.1.9 netbsd-11-0-RC3:1.1.1.9 netbsd-11-0-RC2:1.1.1.9 netbsd-11-0-RC1:1.1.1.9 gcc-14-3-0:1.1.1.10 perseant-exfatfs-base-20250801:1.1.1.9 netbsd-11:1.1.1.9.0.4 netbsd-11-base:1.1.1.9 gcc-12-5-0:1.1.1.9 netbsd-10-1-RELEASE:1.1.1.8 perseant-exfatfs-base-20240630:1.1.1.9 gcc-12-4-0:1.1.1.9 perseant-exfatfs:1.1.1.9.0.2 perseant-exfatfs-base:1.1.1.9 netbsd-9-4-RELEASE:1.1.1.3 netbsd-10-0-RELEASE:1.1.1.8 netbsd-10-0-RC6:1.1.1.8 netbsd-10-0-RC5:1.1.1.8 netbsd-10-0-RC4:1.1.1.8 netbsd-10-0-RC3:1.1.1.8 netbsd-10-0-RC2:1.1.1.8 netbsd-10-0-RC1:1.1.1.8 gcc-12-3-0:1.1.1.9 gcc-10-5-0:1.1.1.8 netbsd-10:1.1.1.8.0.6 netbsd-10-base:1.1.1.8 netbsd-9-3-RELEASE:1.1.1.3 gcc-10-4-0:1.1.1.8 cjep_sun2x-base1:1.1.1.8 cjep_sun2x:1.1.1.8.0.4 cjep_sun2x-base:1.1.1.8 cjep_staticlib_x-base1:1.1.1.8 netbsd-9-2-RELEASE:1.1.1.3 cjep_staticlib_x:1.1.1.8.0.2 cjep_staticlib_x-base:1.1.1.8 gcc-10-3-0:1.1.1.8 netbsd-9-1-RELEASE:1.1.1.3 gcc-9-3-0:1.1.1.7 gcc-7-5-0:1.1.1.5 phil-wifi-20200421:1.1.1.4 phil-wifi-20200411:1.1.1.4 is-mlppp:1.1.1.4.0.2 is-mlppp-base:1.1.1.4 phil-wifi-20200406:1.1.1.4 gcc-8-4-0:1.1.1.6 netbsd-9-0-RELEASE:1.1.1.3 netbsd-9-0-RC2:1.1.1.3 netbsd-9-0-RC1:1.1.1.3 phil-wifi-20191119:1.1.1.4 gcc-8-3-0:1.1.1.4 netbsd-9:1.1.1.3.0.2 netbsd-9-base:1.1.1.3 phil-wifi-20190609:1.1.1.3 pgoyette-compat-merge-20190127:1.1.1.1.2.2 pgoyette-compat-20190127:1.1.1.3 gcc-7-4-0:1.1.1.3 pgoyette-compat-20190118:1.1.1.2 pgoyette-compat-1226:1.1.1.2 pgoyette-compat-1126:1.1.1.2 gcc-6-5-0:1.1.1.2 pgoyette-compat-1020:1.1.1.1 pgoyette-compat-0930:1.1.1.1 pgoyette-compat-0906:1.1.1.1 pgoyette-compat-0728:1.1.1.1 phil-wifi:1.1.1.1.0.4 phil-wifi-base:1.1.1.1 pgoyette-compat-0625:1.1.1.1 pgoyette-compat-0521:1.1.1.1 pgoyette-compat-0502:1.1.1.1 pgoyette-compat-0422:1.1.1.1 pgoyette-compat-0415:1.1.1.1 pgoyette-compat-0407:1.1.1.1 pgoyette-compat-0330:1.1.1.1 pgoyette-compat-0322:1.1.1.1 pgoyette-compat-0315:1.1.1.1 pgoyette-compat:1.1.1.1.0.2 pgoyette-compat-base:1.1.1.1 gcc-6-4-0:1.1.1.1 FSF:1.1.1; locks; strict; comment @# @; 1.1 date 2018.02.02.01.59.03; author mrg; state Exp; branches 1.1.1.1; next ; commitid XNKaycqpfhzd5epA; 1.1.1.1 date 2018.02.02.01.59.03; author mrg; state Exp; branches 1.1.1.1.2.1 1.1.1.1.4.1; next 1.1.1.2; commitid XNKaycqpfhzd5epA; 1.1.1.2 date 2018.11.04.00.12.28; author mrg; state Exp; branches; next 1.1.1.3; commitid bulspy67pMB6EyYA; 1.1.1.3 date 2019.01.19.10.14.11; author mrg; state Exp; branches; next 1.1.1.4; commitid VQ8OwWIg5RS9kn8B; 1.1.1.4 date 2019.10.01.09.36.06; author mrg; state Exp; branches; next 1.1.1.5; commitid smvgr2IPAQDr89FB; 1.1.1.5 date 2020.08.11.05.10.39; author mrg; state Exp; branches; next 1.1.1.6; commitid 5dBRDT7i6e65xBjC; 1.1.1.6 date 2020.08.11.05.30.09; author mrg; state Exp; branches; next 1.1.1.7; commitid 7AI4OfpLi4eqEBjC; 1.1.1.7 date 2020.09.05.07.52.09; author mrg; state Exp; branches; next 1.1.1.8; commitid ZRYA7IOuwfMjAPmC; 1.1.1.8 date 2021.04.10.22.10.05; author mrg; state Exp; branches; next 1.1.1.9; commitid eC4g0MRpqTvEkNOC; 1.1.1.9 date 2023.07.30.05.21.20; author mrg; state Exp; branches 1.1.1.9.2.1; next 1.1.1.10; commitid tk6nV4mbc9nVEMyE; 1.1.1.10 date 2025.09.13.23.45.49; author mrg; state Exp; branches; next ; commitid KwhwN4krNWa6XBaG; 1.1.1.1.2.1 date 2018.11.26.01.50.58; author pgoyette; state Exp; branches; next 1.1.1.1.2.2; commitid Zj4q5SspGdKXto1B; 1.1.1.1.2.2 date 2019.01.26.21.59.34; author pgoyette; state Exp; branches; next ; commitid JKpcmvSjdT25dl9B; 1.1.1.1.4.1 date 2019.06.10.21.54.52; author christos; state Exp; branches; next 1.1.1.1.4.2; commitid jtc8rnCzWiEEHGqB; 1.1.1.1.4.2 date 2020.04.13.07.58.37; author martin; state Exp; branches; next ; commitid X01YhRUPVUDaec4C; 1.1.1.9.2.1 date 2026.11.04.22.51.55; author perseant; state Exp; branches; next ; commitid 3QTNojfCEH9lUb2H; desc @@ 1.1 log @Initial revision @ text @// -*- C++ -*- // Copyright (C) 2015-2016 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . /** @@file experimental/memory_resource * This is a TS C++ Library header. */ #ifndef _GLIBCXX_EXPERIMENTAL_MEMORY_RESOURCE #define _GLIBCXX_EXPERIMENTAL_MEMORY_RESOURCE 1 #include #include #include #include #include #include namespace std { namespace experimental { inline namespace fundamentals_v2 { namespace pmr { _GLIBCXX_BEGIN_NAMESPACE_VERSION #define __cpp_lib_experimental_memory_resources 201402L class memory_resource; template class polymorphic_allocator; template class __resource_adaptor_imp; template using resource_adaptor = __resource_adaptor_imp< typename allocator_traits<_Alloc>::template rebind_alloc>; template struct __uses_allocator_construction_helper; // Global memory resources memory_resource* new_delete_resource() noexcept; memory_resource* null_memory_resource() noexcept; // The default memory resource memory_resource* get_default_resource() noexcept; memory_resource* set_default_resource(memory_resource* __r) noexcept; // Standard memory resources // 8.5 Class memory_resource class memory_resource { protected: static constexpr size_t _S_max_align = alignof(max_align_t); public: virtual ~memory_resource() { } void* allocate(size_t __bytes, size_t __alignment = _S_max_align) { return do_allocate(__bytes, __alignment); } void deallocate(void* __p, size_t __bytes, size_t __alignment = _S_max_align) { return do_deallocate(__p, __bytes, __alignment); } bool is_equal(const memory_resource& __other) const noexcept { return do_is_equal(__other); } protected: virtual void* do_allocate(size_t __bytes, size_t __alignment) = 0; virtual void do_deallocate(void* __p, size_t __bytes, size_t __alignment) = 0; virtual bool do_is_equal(const memory_resource& __other) const noexcept = 0; }; inline bool operator==(const memory_resource& __a, const memory_resource& __b) noexcept { return &__a == &__b || __a.is_equal(__b); } inline bool operator!=(const memory_resource& __a, const memory_resource& __b) noexcept { return !(__a == __b); } // 8.6 Class template polymorphic_allocator template class polymorphic_allocator { using __uses_alloc1_ = __uses_alloc1; using __uses_alloc2_ = __uses_alloc2; template void _M_construct(__uses_alloc0, _Tp1* __p, _Args&&... __args) { ::new(__p) _Tp1(std::forward<_Args>(__args)...); } template void _M_construct(__uses_alloc1_, _Tp1* __p, _Args&&... __args) { ::new(__p) _Tp1(allocator_arg, this->resource(), std::forward<_Args>(__args)...); } template void _M_construct(__uses_alloc2_, _Tp1* __p, _Args&&... __args) { ::new(__p) _Tp1(std::forward<_Args>(__args)..., this->resource()); } public: using value_type = _Tp; polymorphic_allocator() noexcept : _M_resource(get_default_resource()) { } polymorphic_allocator(memory_resource* __r) : _M_resource(__r) { _GLIBCXX_DEBUG_ASSERT(__r); } polymorphic_allocator(const polymorphic_allocator& __other) = default; template polymorphic_allocator(const polymorphic_allocator<_Up>& __other) noexcept : _M_resource(__other.resource()) { } polymorphic_allocator& operator=(const polymorphic_allocator& __rhs) = default; _Tp* allocate(size_t __n) { return static_cast<_Tp*>(_M_resource->allocate(__n * sizeof(_Tp), alignof(_Tp))); } void deallocate(_Tp* __p, size_t __n) { _M_resource->deallocate(__p, __n * sizeof(_Tp), alignof(_Tp)); } template //used here void construct(_Tp1* __p, _Args&&... __args) { auto __use_tag = __use_alloc<_Tp1, memory_resource*, _Args...>(this->resource()); _M_construct(__use_tag, __p, std::forward<_Args>(__args)...); } // Specializations for pair using piecewise construction template void construct(pair<_Tp1, _Tp2>* __p, piecewise_construct_t, tuple<_Args1...> __x, tuple<_Args2...> __y) { auto __x_use_tag = __use_alloc<_Tp1, memory_resource*, _Args1...>(this->resource()); auto __y_use_tag = __use_alloc<_Tp2, memory_resource*, _Args2...>(this->resource()); ::new(__p) std::pair<_Tp1, _Tp2>(piecewise_construct, _M_construct_p(__x_use_tag, __x), _M_construct_p(__y_use_tag, __y)); } template void construct(pair<_Tp1,_Tp2>* __p) { this->construct(__p, piecewise_construct, tuple<>(), tuple<>()); } template void construct(pair<_Tp1,_Tp2>* __p, _Up&& __x, _Vp&& __y) { this->construct(__p, piecewise_construct, forward_as_tuple(std::forward<_Up>(__x)), forward_as_tuple(std::forward<_Vp>(__y))); } template void construct(pair<_Tp1,_Tp2>* __p, const std::pair<_Up, _Vp>& __pr) { this->construct(__p, piecewise_construct, forward_as_tuple(__pr.first), forward_as_tuple(__pr.second)); } template void construct(pair<_Tp1,_Tp2>* __p, pair<_Up, _Vp>&& __pr) { this->construct(__p, piecewise_construct, forward_as_tuple(std::forward<_Up>(__pr.first)), forward_as_tuple(std::forward<_Vp>(__pr.second))); } template void destroy(_Up* __p) { __p->~_Up(); } // Return a default-constructed allocator (no allocator propagation) polymorphic_allocator select_on_container_copy_construction() const { return polymorphic_allocator(); } memory_resource* resource() const { return _M_resource; } private: template _Tuple&& _M_construct_p(__uses_alloc0, _Tuple& __t) { return std::move(__t); } template decltype(auto) _M_construct_p(__uses_alloc1_ __ua, tuple<_Args...>& __t) { return tuple_cat(make_tuple(allocator_arg, *(__ua._M_a)), std::move(__t)); } template decltype(auto) _M_construct_p(__uses_alloc2_ __ua, tuple<_Args...>& __t) { return tuple_cat(std::move(__t), make_tuple(*(__ua._M_a))); } memory_resource* _M_resource; }; template bool operator==(const polymorphic_allocator<_Tp1>& __a, const polymorphic_allocator<_Tp2>& __b) noexcept { return *__a.resource() == *__b.resource(); } template bool operator!=(const polymorphic_allocator<_Tp1>& __a, const polymorphic_allocator<_Tp2>& __b) noexcept { return !(__a == __b); } // 8.7.1 __resource_adaptor_imp template class __resource_adaptor_imp : public memory_resource { public: using allocator_type = _Alloc; __resource_adaptor_imp() = default; __resource_adaptor_imp(const __resource_adaptor_imp&) = default; __resource_adaptor_imp(__resource_adaptor_imp&&) = default; explicit __resource_adaptor_imp(const _Alloc& __a2) : _M_alloc(__a2) { } explicit __resource_adaptor_imp(_Alloc&& __a2) : _M_alloc(std::move(__a2)) { } __resource_adaptor_imp& operator=(const __resource_adaptor_imp&) = default; allocator_type get_allocator() const { return _M_alloc; } protected: virtual void* do_allocate(size_t __bytes, size_t __alignment) { using _Aligned_alloc = std::__alloc_rebind<_Alloc, char>; size_t __new_size = _S_aligned_size(__bytes, _S_supported(__alignment) ? __alignment : _S_max_align); return _Aligned_alloc(_M_alloc).allocate(__new_size); } virtual void do_deallocate(void* __p, size_t __bytes, size_t __alignment) { using _Aligned_alloc = std::__alloc_rebind<_Alloc, char>; size_t __new_size = _S_aligned_size(__bytes, _S_supported(__alignment) ? __alignment : _S_max_align); using _Ptr = typename allocator_traits<_Aligned_alloc>::pointer; _Aligned_alloc(_M_alloc).deallocate(static_cast<_Ptr>(__p), __new_size); } virtual bool do_is_equal(const memory_resource& __other) const noexcept { auto __p = dynamic_cast(&__other); return __p ? (_M_alloc == __p->_M_alloc) : false; } private: // Calculate Aligned Size // Returns a size that is larger than or equal to __size and divisible // by __alignment, where __alignment is required to be the power of 2. static size_t _S_aligned_size(size_t __size, size_t __alignment) { return ((__size - 1)|(__alignment - 1)) + 1; } // Determine whether alignment meets one of those preconditions: // 1. Equals to Zero // 2. Is power of two static bool _S_supported (size_t __x) { return ((__x != 0) && !(__x & (__x - 1))); } _Alloc _M_alloc; }; // Global memory resources inline std::atomic& __get_default_resource() { static atomic _S_default_resource(new_delete_resource()); return _S_default_resource; } inline memory_resource* new_delete_resource() noexcept { static resource_adaptor> __r; return static_cast(&__r); } template class __null_memory_resource : private memory_resource { protected: void* do_allocate(size_t, size_t) { std::__throw_bad_alloc(); } void do_deallocate(void*, size_t, size_t) noexcept { } bool do_is_equal(const memory_resource& __other) const noexcept { return this == &__other; } friend memory_resource* null_memory_resource() noexcept; }; inline memory_resource* null_memory_resource() noexcept { static __null_memory_resource __r; return static_cast(&__r); } // The default memory resource inline memory_resource* get_default_resource() noexcept { return __get_default_resource().load(); } inline memory_resource* set_default_resource(memory_resource* __r) noexcept { if (__r == nullptr) __r = new_delete_resource(); return __get_default_resource().exchange(__r); } _GLIBCXX_END_NAMESPACE_VERSION } // namespace pmr } // namespace fundamentals_v2 } // namespace experimental } // namespace std #endif @ 1.1.1.1 log @import GCC 6.4.0. see this url for details which are too large to include here: http://gcc.gnu.org/gcc-6/changes.html the main visible changes appear to be: - The default mode for C++ is now -std=gnu++14 instead of -std=gnu++98. - The C and C++ compilers now support attributes on enumerators. - Diagnostics can now contain "fix-it hints" - more warnings (some added to -Wall) @ text @@ 1.1.1.1.4.1 log @Sync with HEAD @ text @d3 1 a3 1 // Copyright (C) 2015-2017 Free Software Foundation, Inc. d36 1 d171 2 a172 3 memory_resource* const __resource = this->resource(); auto __use_tag = __use_alloc<_Tp1, memory_resource*, _Args...>(__resource); a182 1 memory_resource* const __resource = this->resource(); d184 1 a184 1 __use_alloc<_Tp1, memory_resource*, _Args1...>(__resource); d186 1 a186 1 __use_alloc<_Tp2, memory_resource*, _Args2...>(__resource); a258 16 static_assert(is_same::value_type>::value, "Allocator's value_type is char"); static_assert(is_same::pointer>::value, "Allocator's pointer type is value_type*"); static_assert(is_same::const_pointer>::value, "Allocator's const_pointer type is value_type const*"); static_assert(is_same::void_pointer>::value, "Allocator's void_pointer type is void*"); static_assert(is_same::const_void_pointer>::value, "Allocator's const_void_pointer type is void const*"); d277 1 a277 1 allocator_type get_allocator() const noexcept { return _M_alloc; } d312 1 a312 1 // by __alignment, where __alignment is required to be a power of 2. d318 1 a318 1 // 1. Equal to Zero d328 6 d338 2 a339 4 using type = resource_adaptor>; alignas(type) static unsigned char __buf[sizeof(type)]; static type* __r = new(__buf) type; return __r; d342 2 a343 4 inline memory_resource* null_memory_resource() noexcept { class type final : public memory_resource d345 1 d347 1 a347 1 do_allocate(size_t, size_t) override d351 1 a351 1 do_deallocate(void*, size_t, size_t) noexcept override d355 1 a355 1 do_is_equal(const memory_resource& __other) const noexcept override d357 2 d361 5 a365 3 alignas(type) static unsigned char __buf[sizeof(type)]; static type* __r = new(__buf) type; return __r; a368 10 inline std::atomic& __get_default_resource() { using type = atomic; alignas(type) static unsigned char __buf[sizeof(type)]; static type* __r = new(__buf) type(new_delete_resource()); return *__r; } @ 1.1.1.1.4.2 log @Mostly merge changes from HEAD upto 20200411 @ text @d3 1 a3 1 // Copyright (C) 2015-2018 Free Software Foundation, Inc. a38 2 _GLIBCXX_BEGIN_NAMESPACE_VERSION d42 2 d400 2 a404 2 _GLIBCXX_END_NAMESPACE_VERSION @ 1.1.1.1.2.1 log @Sync with HEAD, resolve a couple of conflicts @ text @d36 1 a258 16 static_assert(is_same::value_type>::value, "Allocator's value_type is char"); static_assert(is_same::pointer>::value, "Allocator's pointer type is value_type*"); static_assert(is_same::const_pointer>::value, "Allocator's const_pointer type is value_type const*"); static_assert(is_same::void_pointer>::value, "Allocator's void_pointer type is void*"); static_assert(is_same::const_void_pointer>::value, "Allocator's const_void_pointer type is void const*"); d277 1 a277 1 allocator_type get_allocator() const noexcept { return _M_alloc; } d312 1 a312 1 // by __alignment, where __alignment is required to be a power of 2. d318 1 a318 1 // 1. Equal to Zero d328 6 d338 2 a339 4 using type = resource_adaptor>; alignas(type) static unsigned char __buf[sizeof(type)]; static type* __r = new(__buf) type; return __r; d342 2 a343 4 inline memory_resource* null_memory_resource() noexcept { class type final : public memory_resource d345 1 d347 1 a347 1 do_allocate(size_t, size_t) override d351 1 a351 1 do_deallocate(void*, size_t, size_t) noexcept override d355 1 a355 1 do_is_equal(const memory_resource& __other) const noexcept override d357 2 d361 5 a365 3 alignas(type) static unsigned char __buf[sizeof(type)]; static type* __r = new(__buf) type; return __r; a368 10 inline std::atomic& __get_default_resource() { using type = atomic; alignas(type) static unsigned char __buf[sizeof(type)]; static type* __r = new(__buf) type(new_delete_resource()); return *__r; } @ 1.1.1.1.2.2 log @Sync with HEAD @ text @d3 1 a3 1 // Copyright (C) 2015-2017 Free Software Foundation, Inc. d170 2 a171 3 memory_resource* const __resource = this->resource(); auto __use_tag = __use_alloc<_Tp1, memory_resource*, _Args...>(__resource); a181 1 memory_resource* const __resource = this->resource(); d183 1 a183 1 __use_alloc<_Tp1, memory_resource*, _Args1...>(__resource); d185 1 a185 1 __use_alloc<_Tp2, memory_resource*, _Args2...>(__resource); @ 1.1.1.2 log @import GCC 6.5.0. this is largely a maint release with no particularly features listed here: http://gcc.gnu.org/gcc-6/changes.html this fixes over 250 PRs in the GCC bugzilla: https://gcc.gnu.org/bugzilla/buglist.cgi?bug_status=RESOLVED&resolution=FIXED&target_milestone=6.5 @ text @d36 1 a258 16 static_assert(is_same::value_type>::value, "Allocator's value_type is char"); static_assert(is_same::pointer>::value, "Allocator's pointer type is value_type*"); static_assert(is_same::const_pointer>::value, "Allocator's const_pointer type is value_type const*"); static_assert(is_same::void_pointer>::value, "Allocator's void_pointer type is void*"); static_assert(is_same::const_void_pointer>::value, "Allocator's const_void_pointer type is void const*"); d277 1 a277 1 allocator_type get_allocator() const noexcept { return _M_alloc; } d312 1 a312 1 // by __alignment, where __alignment is required to be a power of 2. d318 1 a318 1 // 1. Equal to Zero d328 6 d338 2 a339 4 using type = resource_adaptor>; alignas(type) static unsigned char __buf[sizeof(type)]; static type* __r = new(__buf) type; return __r; d342 2 a343 4 inline memory_resource* null_memory_resource() noexcept { class type final : public memory_resource d345 1 d347 1 a347 1 do_allocate(size_t, size_t) override d351 1 a351 1 do_deallocate(void*, size_t, size_t) noexcept override d355 1 a355 1 do_is_equal(const memory_resource& __other) const noexcept override d357 2 d361 5 a365 3 alignas(type) static unsigned char __buf[sizeof(type)]; static type* __r = new(__buf) type; return __r; a368 10 inline std::atomic& __get_default_resource() { using type = atomic; alignas(type) static unsigned char __buf[sizeof(type)]; static type* __r = new(__buf) type(new_delete_resource()); return *__r; } @ 1.1.1.3 log @import GCC 7.4.0. main changes include: The non-standard C++0x type traits has_trivial_default_constructor, has_trivial_copy_constructor and has_trivial_copy_assign have been removed. On ARM targets (arm*-*-*), a bug introduced in GCC 5 that affects conformance to the procedure call standard (AAPCS) has been fixed. Many optimiser improvements DWARF-5 support. Many new and enhanced warnings. Warnings about format strings now underline the pertinent part of the string, and can offer suggested fixes. Several new warnings related to buffer overflows and buffer truncation. New __builtin_add_overflow_p, __builtin_sub_overflow_p, __builtin_mul_overflow_p built-ins added that test for overflow. The C++ front end has experimental support for all of the current C++17 draft. The -fverbose-asm option has been expanded to prints comments showing the source lines that correspond to the assembly. The gcc and g++ driver programs will now provide suggestions for misspelled arguments to command-line options. AArch64 specific: GCC has been updated to the latest revision of the procedure call standard (AAPCS64) to provide support for parameter passing when data types have been over-aligned. The ARMv8.2-A and ARMv8.3-A architecture are now supported. ARM specific: Support for the ARMv5 and ARMv5E architectures has been deprecated (which have no known implementations). A new command-line option -mpure-code has been added. It does not allow constant data to be placed in code sections. x86 specific: Support for the AVX-512 4FMAPS, 4VNNIW, VPOPCNTDQ and Software Guard Extensions (SGX) ISA extensions has been added. PPC specific: GCC now diagnoses inline assembly that clobbers register r2. RISC-V specific: Support for the RISC-V instruction set has been added. SH specific: Support for SH5/SH64 has been removed. Support for SH2A has been enhanced. @ text @d3 1 a3 1 // Copyright (C) 2015-2017 Free Software Foundation, Inc. d170 2 a171 3 memory_resource* const __resource = this->resource(); auto __use_tag = __use_alloc<_Tp1, memory_resource*, _Args...>(__resource); a181 1 memory_resource* const __resource = this->resource(); d183 1 a183 1 __use_alloc<_Tp1, memory_resource*, _Args1...>(__resource); d185 1 a185 1 __use_alloc<_Tp2, memory_resource*, _Args2...>(__resource); @ 1.1.1.4 log @import GCC 8.3. it includes these new features: - many optimisations improved: inter-procedural, profile-directed, LTO, loops including user-controllable unroll support, and more. - columns numbers added to line numbers in dwarf - gcov extended significantly - many sanitizer updates - many new warning messages - many better hints and more useful error messages - minor ABI changes on x86-64 libstdc++, and some c++17 modes - draft c++2a features - better c++17 experimental support - Armv8.4-A supported, better 8.2-A and 8.3-A support, including 32 bit arm port. cortex a-55, a-75 and a-55.a-75 combo support. - in the GCC bugzilla, 8.1 shows 1149 bugs fixed, 8.2 shows 100, and 8.3 shows 158. @ text @d3 1 a3 1 // Copyright (C) 2015-2018 Free Software Foundation, Inc. a38 2 _GLIBCXX_BEGIN_NAMESPACE_VERSION d42 2 d400 2 a404 2 _GLIBCXX_END_NAMESPACE_VERSION @ 1.1.1.5 log @import GCC 7.5.0. doing this here so that the vendor branch has the code we'll merge into gcc.old and the netbsd-9 tree gcc tree. GCC 8.4.0 will be imported immediately on top of this again, restoring the current status. these PRs in the GCC bugzilla are fixed with this update: 89869 80693 89795 84272 85593 86669 87148 87647 87895 88103 88107 88563 88870 88976 89002 89187 89195 89234 89303 89314 89354 89361 89403 89412 89512 89520 89590 89621 89663 89679 89704 89734 89872 89933 90090 90208 87075 85870 89009 89242 88167 80864 81933 85890 86608 87145 88857 89024 89119 89214 89511 89612 89705 89400 81740 82186 84552 86554 87609 88105 88149 88415 88739 88903 89135 89223 89296 89505 89572 89677 89698 89710 90006 90020 90071 90328 90474 91126 91162 91812 91887 90075 88998 89945 87047 87506 88074 88656 88740 91137 89008 84010 89349 91136 91347 91995 89397 87030 60702 78884 85594 87649 87725 88181 88470 88553 88568 88588 88620 88644 88906 88949 89246 89587 89726 89768 89796 89998 90108 90756 90950 91704 88825 88983 86538 51333 89446 90220 91308 92143 89392 90213 90278 91131 91200 91510 89037 91481 87673 88418 88938 88948 90547 27221 58321 61250 67183 67958 77583 83531 86215 88648 88720 88726 89091 89466 89629 90105 90329 90585 90760 90924 91087 89222 81956 71861 35031 69455 81849 82993 85798 88138 88155 88169 88205 88206 88228 88249 88269 88376 77703 80260 82077 86248 88393 90786 57048 66089 66695 67679 68009 71723 72714 84394 85544 87734 88298 90937 91557 63891 64132 65342 68649 68717 71066 71860 71935 77746 78421 78645 78865 78983 79485 79540 85953 88326 89651 90744 @ text @d3 1 a3 1 // Copyright (C) 2015-2017 Free Software Foundation, Inc. d39 2 a43 2 _GLIBCXX_BEGIN_NAMESPACE_VERSION a399 2 _GLIBCXX_END_NAMESPACE_VERSION d403 2 @ 1.1.1.6 log @re-import GCC 8.4.0. @ text @d3 1 a3 1 // Copyright (C) 2015-2018 Free Software Foundation, Inc. a38 2 _GLIBCXX_BEGIN_NAMESPACE_VERSION d42 2 d400 2 a404 2 _GLIBCXX_END_NAMESPACE_VERSION @ 1.1.1.7 log @initial import of GCC 9.3.0. changes include: - live patching support - shell completion help - generally better diagnostic output (less verbose/more useful) - diagnostics and optimisation choices can be emitted in json - asan memory usage reduction - many general, and specific to switch, inter-procedure, profile and link-time optimisations. from the release notes: "Overall compile time of Firefox 66 and LibreOffice 6.2.3 on an 8-core machine was reduced by about 5% compared to GCC 8.3" - OpenMP 5.0 support - better spell-guesser - partial experimental support for c2x and c++2a - c++17 is no longer experimental - arm AAPCS GCC 6-8 structure passing bug fixed, may cause incompatibility (restored compat with GCC 5 and earlier.) - openrisc support @ text @d3 1 a3 1 // Copyright (C) 2015-2019 Free Software Foundation, Inc. d32 5 a36 14 #include // align, uses_allocator, __uses_alloc #include // pair, experimental::erased_type #include // atomic #include // placement new #include // max_align_t #include #include namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION template class malloc_allocator; _GLIBCXX_END_NAMESPACE_VERSION } // namespace __gnu_cxx a45 3 // Standard memory resources // 8.5 Class memory_resource d48 1 a48 2 // 8.6 Class template polymorphic_allocator template d51 1 a51 1 template d54 1 a54 2 // 8.7 Alias template resource_adaptor template d58 4 a61 1 // 8.8 Global memory resources d64 2 d69 1 a69 1 // TODO 8.9 Pool resource classes d71 1 d74 1 d78 1 a78 5 memory_resource() = default; memory_resource(const memory_resource&) = default; virtual ~memory_resource() = default; memory_resource& operator=(const memory_resource&) = default; d80 1 a80 1 _GLIBCXX_NODISCARD void* d104 2 a105 1 operator==(const memory_resource& __a, const memory_resource& __b) noexcept d109 2 a110 1 operator!=(const memory_resource& __a, const memory_resource& __b) noexcept d114 2 a115 1 template d118 20 d160 1 a160 1 _GLIBCXX_NODISCARD _Tp* allocate(size_t __n) d164 1 a164 2 void deallocate(_Tp* __p, size_t __n) d168 1 a168 2 void construct(_Tp1* __p, _Args&&... __args) d170 4 a173 2 std::__uses_allocator_construct(this->resource(), __p, std::forward<_Args>(__args)...); d179 3 a181 3 void construct(pair<_Tp1, _Tp2>* __p, piecewise_construct_t, tuple<_Args1...> __x, tuple<_Args2...> __y) d185 1 a185 1 std::__use_alloc<_Tp1, memory_resource*, _Args1...>(__resource); d187 1 a187 1 std::__use_alloc<_Tp2, memory_resource*, _Args2...>(__resource); d195 1 a195 2 void construct(pair<_Tp1,_Tp2>* __p) d199 2 a200 4 void construct(pair<_Tp1,_Tp2>* __p, _Up&& __x, _Vp&& __y) { this->construct(__p, piecewise_construct, d202 1 a202 2 forward_as_tuple(std::forward<_Vp>(__y))); } d205 3 a207 7 void construct(pair<_Tp1,_Tp2>* __p, const std::pair<_Up, _Vp>& __pr) { this->construct(__p, piecewise_construct, forward_as_tuple(__pr.first), forward_as_tuple(__pr.second)); } d210 2 a211 4 void construct(pair<_Tp1,_Tp2>* __p, pair<_Up, _Vp>&& __pr) { this->construct(__p, piecewise_construct, d213 1 a213 2 forward_as_tuple(std::forward<_Vp>(__pr.second))); } d216 1 a216 2 void destroy(_Up* __p) d220 1 a220 2 polymorphic_allocator select_on_container_copy_construction() const d223 2 a224 1 memory_resource* resource() const { return _M_resource; } a226 3 using __uses_alloc1_ = __uses_alloc1; using __uses_alloc2_ = __uses_alloc2; d247 2 a248 3 bool operator==(const polymorphic_allocator<_Tp1>& __a, const polymorphic_allocator<_Tp2>& __b) noexcept d252 2 a253 3 bool operator!=(const polymorphic_allocator<_Tp1>& __a, const polymorphic_allocator<_Tp2>& __b) noexcept a255 115 class __resource_adaptor_common { template friend class __resource_adaptor_imp; struct _AlignMgr { _AlignMgr(size_t __nbytes, size_t __align) : _M_nbytes(__nbytes), _M_align(__align) { } // Total size that needs to be allocated. size_t _M_alloc_size() const { return _M_buf_size() + _M_token_size(); } void* _M_adjust(void* __ptr) const { const auto __orig_ptr = static_cast(__ptr); size_t __space = _M_buf_size(); // Align the pointer within the buffer: std::align(_M_align, _M_nbytes, __ptr, __space); const auto __aligned_ptr = static_cast(__ptr); const auto __token_size = _M_token_size(); // Store token immediately after the aligned block: char* const __end = __aligned_ptr + _M_nbytes; if (__token_size == 1) _S_write(__end, __aligned_ptr - __orig_ptr); else if (__token_size == sizeof(short)) _S_write(__end, __aligned_ptr - __orig_ptr); else if (__token_size == sizeof(int) && sizeof(int) < sizeof(char*)) _S_write(__end, __aligned_ptr - __orig_ptr); else // (__token_size == sizeof(char*)) // Just store the original pointer: _S_write(__end, __orig_ptr); return __aligned_ptr; } char* _M_unadjust(char* __ptr) const { const char* const __end = __ptr + _M_nbytes; char* __orig_ptr; const auto __token_size = _M_token_size(); // Read the token and restore the original pointer: if (__token_size == 1) __orig_ptr = __ptr - _S_read(__end); else if (__token_size == sizeof(short)) __orig_ptr = __ptr - _S_read(__end); else if (__token_size == sizeof(int) && sizeof(int) < sizeof(char*)) __orig_ptr = __ptr - _S_read(__end); else // (__token_size == sizeof(char*)) __orig_ptr = _S_read(__end); // The adjustment is always less than the requested alignment, // so if that isn't true now then either the wrong size was passed // to deallocate or the token was overwritten by a buffer overflow: __glibcxx_assert(static_cast(__ptr - __orig_ptr) < _M_align); return __orig_ptr; } private: size_t _M_nbytes; size_t _M_align; // Number of bytes needed to fit block of given size and alignment. size_t _M_buf_size() const { return _M_nbytes + _M_align - 1; } // Number of additional bytes needed to write the token. int _M_token_size() const { if (_M_align <= (1ul << __CHAR_BIT__)) return 1; if (_M_align <= (1ul << (sizeof(short) * __CHAR_BIT__))) return sizeof(short); if (_M_align <= (1ull << (sizeof(int) * __CHAR_BIT__))) return sizeof(int); return sizeof(char*); } template static void _S_write(void* __to, _Tp __val) { __builtin_memcpy(__to, &__val, sizeof(_Tp)); } template static _Tp _S_read(const void* __from) { _Tp __val; __builtin_memcpy(&__val, __from, sizeof(_Tp)); return __val; } }; template struct __guaranteed_alignment : std::integral_constant { }; template struct __guaranteed_alignment<__gnu_cxx::new_allocator<_Tp>> : std::alignment_of::type { }; template struct __guaranteed_alignment<__gnu_cxx::malloc_allocator<_Tp>> : std::alignment_of::type { }; #if _GLIBCXX_USE_ALLOCATOR_NEW template struct __guaranteed_alignment> : std::alignment_of::type { }; #endif }; d257 2 a258 3 template class __resource_adaptor_imp : public _Resource, private __resource_adaptor_common a259 2 using memory_resource = _Resource; d298 1 a298 1 do_allocate(size_t __bytes, size_t __alignment) override d300 5 a304 13 if (__alignment <= __guaranteed_alignment<_Alloc>::value) { if (__bytes < __alignment) __bytes = __alignment; return _M_alloc.allocate(__bytes); } const _AlignMgr __mgr(__bytes, __alignment); // Assume _M_alloc returns 1-byte aligned memory, so allocate enough // space to fit a block of the right size and alignment, plus some // extra bytes to store a token for retrieving the original pointer. return __mgr._M_adjust(_M_alloc.allocate(__mgr._M_alloc_size())); d308 1 a308 2 do_deallocate(void* __p, size_t __bytes, size_t __alignment) noexcept override d310 7 a316 12 auto __ptr = static_cast(__p); if (__alignment <= __guaranteed_alignment<_Alloc>::value) { if (__bytes < __alignment) __bytes = __alignment; _M_alloc.deallocate(__ptr, __bytes); return; } const _AlignMgr __mgr(__bytes, __alignment); // Use the stored token to retrieve the original pointer to deallocate. _M_alloc.deallocate(__mgr._M_unadjust(__ptr), __mgr._M_alloc_size()); d320 1 a320 1 do_is_equal(const memory_resource& __other) const noexcept override d322 2 a323 3 if (auto __p = dynamic_cast(&__other)) return _M_alloc == __p->_M_alloc; return false; d327 15 a341 1 _Alloc _M_alloc{}; d349 1 a349 1 using type = resource_adaptor<__gnu_cxx::new_allocator>; a399 1 d406 2 a407 1 #endif // _GLIBCXX_EXPERIMENTAL_MEMORY_RESOURCE @ 1.1.1.8 log @initial import of GCC 10.3.0. main changes include: caveats: - ABI issue between c++14 and c++17 fixed - profile mode is removed from libstdc++ - -fno-common is now the default new features: - new flags -fallocation-dce, -fprofile-partial-training, -fprofile-reproducible, -fprofile-prefix-path, and -fanalyzer - many new compile and link time optimisations - enhanced drive optimisations - openacc 2.6 support - openmp 5.0 features - new warnings: -Wstring-compare and -Wzero-length-bounds - extended warnings: -Warray-bounds, -Wformat-overflow, -Wrestrict, -Wreturn-local-addr, -Wstringop-overflow, -Warith-conversion, -Wmismatched-tags, and -Wredundant-tags - some likely C2X features implemented - more C++20 implemented - many new arm & intel CPUs known hundreds of reported bugs are fixed. full list of changes can be found at: https://gcc.gnu.org/gcc-10/changes.html @ text @d3 1 a3 1 // Copyright (C) 2015-2020 Free Software Foundation, Inc. a26 1 * @@ingroup libfund-ts a31 4 #pragma GCC system_header #if __cplusplus >= 201402L a39 1 /// @@cond a45 1 /// @@endcond a261 1 /// @@cond undocumented d357 17 a374 1 /// @@endcond d423 1 a423 6 // Cannot use max_align_t on 32-bit Solaris x86, see PR libstdc++/77691 #if ! ((defined __sun__ || defined __VXWORKS__) && defined __i386__) if (__alignment == alignof(max_align_t)) return _M_allocate(__bytes); #endif switch (__alignment) d425 2 a426 1 case 1: a427 6 case 2: return _M_allocate<2>(__bytes); case 4: return _M_allocate<4>(__bytes); case 8: return _M_allocate<8>(__bytes); d429 2 d439 1 a439 1 do_deallocate(void* __ptr, size_t __bytes, size_t __alignment) noexcept d442 2 a443 5 #if ! ((defined __sun__ || defined __VXWORKS__) && defined __i386__) if (__alignment == alignof(max_align_t)) return (void) _M_deallocate(__ptr, __bytes); #endif switch (__alignment) d445 4 a448 8 case 1: return (void) _M_alloc.deallocate((char*)__ptr, __bytes); case 2: return (void) _M_deallocate<2>(__ptr, __bytes); case 4: return (void) _M_deallocate<4>(__ptr, __bytes); case 8: return (void) _M_deallocate<8>(__ptr, __bytes); d450 1 d452 2 a453 3 // Use the stored token to retrieve the original pointer. _M_alloc.deallocate(__mgr._M_unadjust((char*)__ptr), __mgr._M_alloc_size()); a464 25 template struct _Aligned_type { alignas(_Num) char __c[_Num]; }; // Rebind the allocator to the specified type and use it to allocate. template> void* _M_allocate(size_t __bytes) { typename allocator_traits<_Alloc>::template rebind_alloc<_Tp> __a2(_M_alloc); const size_t __n = (__bytes + _Num - 1) / _Num; return __a2.allocate(__n); } // Rebind the allocator to the specified type and use it to deallocate. template> void _M_deallocate(void* __ptr, size_t __bytes) noexcept { typename allocator_traits<_Alloc>::template rebind_alloc<_Tp> __a2(_M_alloc); const size_t __n = (__bytes + _Num - 1) / _Num; __a2.deallocate((_Tp*)__ptr, __n); } a503 1 /// @@cond undocumented a511 1 /// @@endcond a512 1 /// Get the current default resource. a516 1 /// Change the default resource and return the previous one. a530 1 #endif // C++14 @ 1.1.1.9 log @initial import of GCC 12.3.0. major changes in GCC 11 included: - The default mode for C++ is now -std=gnu++17 instead of -std=gnu++14. - When building GCC itself, the host compiler must now support C++11, rather than C++98. - Some short options of the gcov tool have been renamed: -i to -j and -j to -H. - ThreadSanitizer improvements. - Introduce Hardware-assisted AddressSanitizer support. - For targets that produce DWARF debugging information GCC now defaults to DWARF version 5. This can produce up to 25% more compact debug information compared to earlier versions. - Many optimisations. - The existing malloc attribute has been extended so that it can be used to identify allocator/deallocator API pairs. A pair of new -Wmismatched-dealloc and -Wmismatched-new-delete warnings are added. - Other new warnings: -Wsizeof-array-div, enabled by -Wall, warns about divisions of two sizeof operators when the first one is applied to an array and the divisor does not equal the size of the array element. -Wstringop-overread, enabled by default, warns about calls to string functions reading past the end of the arrays passed to them as arguments. -Wtsan, enabled by default, warns about unsupported features in ThreadSanitizer (currently std::atomic_thread_fence). - Enchanced warnings: -Wfree-nonheap-object detects many more instances of calls to deallocation functions with pointers not returned from a dynamic memory allocation function. -Wmaybe-uninitialized diagnoses passing pointers or references to uninitialized memory to functions taking const-qualified arguments. -Wuninitialized detects reads from uninitialized dynamically allocated memory. -Warray-parameter warns about functions with inconsistent array forms. -Wvla-parameter warns about functions with inconsistent VLA forms. - Several new features from the upcoming C2X revision of the ISO C standard are supported with -std=c2x and -std=gnu2x. - Several C++20 features have been implemented. - The C++ front end has experimental support for some of the upcoming C++23 draft. - Several new C++ warnings. - Enhanced Arm, AArch64, x86, and RISC-V CPU support. - The implementation of how program state is tracked within -fanalyzer has been completely rewritten with many enhancements. see https://gcc.gnu.org/gcc-11/changes.html for a full list. major changes in GCC 12 include: - An ABI incompatibility between C and C++ when passing or returning by value certain aggregates containing zero width bit-fields has been discovered on various targets. x86-64, ARM and AArch64 will always ignore them (so there is a C ABI incompatibility between GCC 11 and earlier with GCC 12 or later), PowerPC64 ELFv2 always take them into account (so there is a C++ ABI incompatibility, GCC 4.4 and earlier compatible with GCC 12 or later, incompatible with GCC 4.5 through GCC 11). RISC-V has changed the handling of these already starting with GCC 10. As the ABI requires, MIPS takes them into account handling function return values so there is a C++ ABI incompatibility with GCC 4.5 through 11. - STABS: Support for emitting the STABS debugging format is deprecated and will be removed in the next release. All ports now default to emit DWARF (version 2 or later) debugging info or are obsoleted. - Vectorization is enabled at -O2 which is now equivalent to the original -O2 -ftree-vectorize -fvect-cost-model=very-cheap. - GCC now supports the ShadowCallStack sanitizer. - Support for __builtin_shufflevector compatible with the clang language extension was added. - Support for attribute unavailable was added. - Support for __builtin_dynamic_object_size compatible with the clang language extension was added. - New warnings: -Wbidi-chars warns about potentially misleading UTF-8 bidirectional control characters. -Warray-compare warns about comparisons between two operands of array type. - Some new features from the upcoming C2X revision of the ISO C standard are supported with -std=c2x and -std=gnu2x. - Several C++23 features have been implemented. - Many C++ enhancements across warnings and -f options. see https://gcc.gnu.org/gcc-12/changes.html for a full list. @ text @d3 1 a3 1 // Copyright (C) 2015-2022 Free Software Foundation, Inc. a38 1 #include // tuple, forward_as_tuple d42 1 a42 1 #include d199 2 a200 2 std::forward_as_tuple(std::forward<_Up>(__x)), std::forward_as_tuple(std::forward<_Vp>(__y))); d208 2 a209 2 std::forward_as_tuple(__pr.first), std::forward_as_tuple(__pr.second)); d217 2 a218 2 std::forward_as_tuple(std::forward<_Up>(__pr.first)), std::forward_as_tuple(std::forward<_Vp>(__pr.second))); d505 1 a505 1 using type = resource_adaptor>; @ 1.1.1.9.2.1 log @Sync with HEAD @ text @d3 1 a3 1 // Copyright (C) 2015-2024 Free Software Foundation, Inc. a34 2 #include // experimental is currently omitted d46 1 d53 1 a412 10 #if (defined __sun__ || defined __VXWORKS__) && defined __i386__ // Cannot use max_align_t on 32-bit Solaris x86, see PR libstdc++/77691 # define _GLIBCXX_MAX_ALIGN_MATCHES_MALLOC 0 #elif defined __hpux__ && defined __hppa__ && defined __LP64__ // Ignore inconsistent long double and malloc alignment (libstdc++/77691) # define _GLIBCXX_MAX_ALIGN_MATCHES_MALLOC 0 #else # define _GLIBCXX_MAX_ALIGN_MATCHES_MALLOC 1 #endif d416 2 a417 1 #if _GLIBCXX_MAX_ALIGN_MATCHES_MALLOC d443 1 a443 1 #if _GLIBCXX_MAX_ALIGN_MATCHES_MALLOC a466 1 #if __cpp_rtti a468 4 #else if (this == &__other) // Need RTTI to do better than this. return true; #endif d538 1 a538 1 inline auto& a540 9 #ifndef _GLIBCXX_HAS_GTHREADS struct type { using value_type = memory_resource*; explicit type(value_type __r) : _M_r(__r) { } value_type _M_r; value_type load() const { return _M_r; } value_type exchange(value_type __r) { return std::__exchange(_M_r, __r); } }; #else a541 1 #endif @ 1.1.1.10 log @initial import of GCC 14.3.0. major changes in GCC 13: - improved sanitizer - zstd debug info compression - LTO improvements - SARIF based diagnostic support - new warnings: -Wxor-used-as-pow, -Wenum-int-mismatch, -Wself-move, -Wdangling-reference - many new -Wanalyzer* specific warnings - enhanced warnings: -Wpessimizing-move, -Wredundant-move - new attributes to mark file descriptors, c++23 "assume" - several C23 features added - several C++23 features added - many new features for Arm, x86, RISC-V major changes in GCC 14: - more strict C99 or newer support - ia64* marked deprecated (but seemingly still in GCC 15.) - several new hardening features - support for "hardbool", which can have user supplied values of true/false - explicit support for stack scrubbing upon function exit - better auto-vectorisation support - added clang-compatible __has_feature and __has_extension - more C23, including -std=c23 - several C++26 features added - better diagnostics in C++ templates - new warnings: -Wnrvo, Welaborated-enum-base - many new features for Arm, x86, RISC-V - possible ABI breaking change for SPARC64 and small structures with arrays of floats. @ text @d3 1 a3 1 // Copyright (C) 2015-2024 Free Software Foundation, Inc. a34 2 #include // experimental is currently omitted d46 1 d53 1 a412 10 #if (defined __sun__ || defined __VXWORKS__) && defined __i386__ // Cannot use max_align_t on 32-bit Solaris x86, see PR libstdc++/77691 # define _GLIBCXX_MAX_ALIGN_MATCHES_MALLOC 0 #elif defined __hpux__ && defined __hppa__ && defined __LP64__ // Ignore inconsistent long double and malloc alignment (libstdc++/77691) # define _GLIBCXX_MAX_ALIGN_MATCHES_MALLOC 0 #else # define _GLIBCXX_MAX_ALIGN_MATCHES_MALLOC 1 #endif d416 2 a417 1 #if _GLIBCXX_MAX_ALIGN_MATCHES_MALLOC d443 1 a443 1 #if _GLIBCXX_MAX_ALIGN_MATCHES_MALLOC a466 1 #if __cpp_rtti a468 4 #else if (this == &__other) // Need RTTI to do better than this. return true; #endif d538 1 a538 1 inline auto& a540 9 #ifndef _GLIBCXX_HAS_GTHREADS struct type { using value_type = memory_resource*; explicit type(value_type __r) : _M_r(__r) { } value_type _M_r; value_type load() const { return _M_r; } value_type exchange(value_type __r) { return std::__exchange(_M_r, __r); } }; #else a541 1 #endif @