From 969979d6c7f1d160f5fe6ae642fa7b6381634ea7 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Mon, 28 Aug 2023 15:03:36 -0700 Subject: [PATCH] [wpiutil] Update to foonathan memory 0.7-3 (#5573) --- upstream_utils/update_memory.py | 2 +- .../include/wpi/memory/aligned_allocator.hpp | 7 ++-- .../include/wpi/memory/allocator_storage.hpp | 37 ++++++++++--------- .../include/wpi/memory/allocator_traits.hpp | 30 +++++++-------- .../memory/include/wpi/memory/config.hpp | 7 ++-- .../memory/include/wpi/memory/container.hpp | 23 +++++++----- .../memory/include/wpi/memory/debugging.hpp | 5 +-- .../include/wpi/memory/default_allocator.hpp | 5 +-- .../memory/include/wpi/memory/deleter.hpp | 5 +-- .../include/wpi/memory/detail/align.hpp | 5 +-- .../include/wpi/memory/detail/assert.hpp | 5 +-- .../memory/detail/container_node_sizes.hpp | 5 +-- .../wpi/memory/detail/debug_helpers.hpp | 5 +-- .../include/wpi/memory/detail/ebo_storage.hpp | 5 +-- .../include/wpi/memory/detail/free_list.hpp | 5 +-- .../wpi/memory/detail/free_list_array.hpp | 5 +-- .../include/wpi/memory/detail/ilog2.hpp | 5 +-- .../wpi/memory/detail/lowlevel_allocator.hpp | 5 +-- .../wpi/memory/detail/memory_stack.hpp | 5 +-- .../wpi/memory/detail/small_free_list.hpp | 5 +-- .../include/wpi/memory/detail/utility.hpp | 5 +-- .../memory/include/wpi/memory/error.hpp | 5 +-- .../include/wpi/memory/fallback_allocator.hpp | 5 +-- .../include/wpi/memory/heap_allocator.hpp | 5 +-- .../wpi/memory/iteration_allocator.hpp | 9 ++--- .../include/wpi/memory/joint_allocator.hpp | 11 +++--- .../include/wpi/memory/malloc_allocator.hpp | 5 +-- .../include/wpi/memory/memory_arena.hpp | 7 ++-- .../memory/include/wpi/memory/memory_pool.hpp | 9 ++--- .../wpi/memory/memory_pool_collection.hpp | 15 ++++---- .../include/wpi/memory/memory_pool_type.hpp | 7 ++-- .../wpi/memory/memory_resource_adapter.hpp | 5 +-- .../include/wpi/memory/memory_stack.hpp | 8 ++-- .../include/wpi/memory/namespace_alias.hpp | 5 +-- .../include/wpi/memory/new_allocator.hpp | 5 +-- .../memory/include/wpi/memory/segregator.hpp | 5 +-- .../memory/include/wpi/memory/smart_ptr.hpp | 17 +-------- .../include/wpi/memory/static_allocator.hpp | 5 +-- .../include/wpi/memory/std_allocator.hpp | 11 +++--- .../wpi/memory/temporary_allocator.hpp | 9 ++--- .../memory/include/wpi/memory/threading.hpp | 5 +-- .../memory/include/wpi/memory/tracking.hpp | 5 +-- .../include/wpi/memory/virtual_memory.hpp | 5 +-- .../thirdparty/memory/src/debugging.cpp | 5 +-- .../thirdparty/memory/src/detail/align.cpp | 5 +-- .../thirdparty/memory/src/detail/assert.cpp | 5 +-- .../memory/src/detail/debug_helpers.cpp | 5 +-- .../memory/src/detail/free_list.cpp | 5 +-- .../memory/src/detail/free_list_array.cpp | 5 +-- .../memory/src/detail/free_list_utils.hpp | 5 +-- .../memory/src/detail/small_free_list.cpp | 5 +-- .../native/thirdparty/memory/src/error.cpp | 5 +-- .../thirdparty/memory/src/heap_allocator.cpp | 5 +-- .../memory/src/iteration_allocator.cpp | 5 +-- .../memory/src/malloc_allocator.cpp | 5 +-- .../thirdparty/memory/src/memory_arena.cpp | 7 ++-- .../thirdparty/memory/src/memory_pool.cpp | 5 +-- .../memory/src/memory_pool_collection.cpp | 5 +-- .../thirdparty/memory/src/memory_stack.cpp | 5 +-- .../thirdparty/memory/src/new_allocator.cpp | 5 +-- .../memory/src/static_allocator.cpp | 11 +++--- .../memory/src/temporary_allocator.cpp | 10 ++--- .../thirdparty/memory/src/virtual_memory.cpp | 5 +-- 63 files changed, 196 insertions(+), 261 deletions(-) diff --git a/upstream_utils/update_memory.py b/upstream_utils/update_memory.py index e72717a792..6645aaf60c 100755 --- a/upstream_utils/update_memory.py +++ b/upstream_utils/update_memory.py @@ -59,7 +59,7 @@ def run_global_replacements(memory_files): def main(): - upstream_root = clone_repo("https://github.com/foonathan/memory", "v0.7-2") + upstream_root = clone_repo("https://github.com/foonathan/memory", "v0.7-3") wpilib_root = get_repo_root() wpiutil = os.path.join(wpilib_root, "wpiutil") diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/aligned_allocator.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/aligned_allocator.hpp index 8118ec4827..3083a4029e 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/aligned_allocator.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/aligned_allocator.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_ALIGNED_ALLOCATOR_HPP_INCLUDED #define WPI_MEMORY_ALIGNED_ALLOCATOR_HPP_INCLUDED @@ -52,7 +51,7 @@ namespace wpi aligned_allocator& operator=(aligned_allocator&& other) noexcept { allocator_type::operator=(detail::move(other)); - min_alignment_ = other.min_alignment_; + min_alignment_ = other.min_alignment_; return *this; } /// @} diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/allocator_storage.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/allocator_storage.hpp index 8dab2e0b86..dc9067222a 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/allocator_storage.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/allocator_storage.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_ALLOCATOR_STORAGE_HPP_INCLUDED #define WPI_MEMORY_ALLOCATOR_STORAGE_HPP_INCLUDED @@ -126,7 +125,7 @@ namespace wpi WPI_REQUIRES( (!std::is_base_of::type>::value))> allocator_storage(Alloc&& alloc, - WPI_SFINAE(new storage_policy(detail::forward(alloc)))) + WPI_SFINAE(new storage_policy(std::declval()))) : storage_policy(detail::forward(alloc)) { } @@ -136,8 +135,10 @@ namespace wpi /// \requires The expression new storage_policy(other.get_allocator()) must be well-formed, /// otherwise this constructor does not participate in overload resolution. template - allocator_storage(const allocator_storage& other, - WPI_SFINAE(new storage_policy(other.get_allocator()))) + allocator_storage( + const allocator_storage& other, + WPI_SFINAE(new storage_policy( + std::declval&>().get_allocator()))) : storage_policy(other.get_allocator()) { } @@ -165,7 +166,7 @@ namespace wpi /// @{ /// \effects Copies the \c allocator_storage object. /// \requires The \c StoragePolicy must be copyable. - allocator_storage(const allocator_storage&) = default; + allocator_storage(const allocator_storage&) = default; allocator_storage& operator=(const allocator_storage&) = default; /// @} @@ -296,9 +297,9 @@ namespace wpi return detail::lock_allocator(get_allocator(), static_cast(*this)); } - auto lock() const noexcept -> WPI_IMPL_DEFINED(decltype( - detail::lock_allocator(std::declval().get_allocator(), - std::declval()))) + auto lock() const noexcept -> WPI_IMPL_DEFINED(decltype(detail::lock_allocator( + std::declval().get_allocator(), + std::declval()))) { return detail::lock_allocator(get_allocator(), static_cast(*this)); } @@ -552,9 +553,9 @@ namespace wpi { using storage = detail::reference_storage_impl< typename allocator_traits::allocator_type, - decltype( - detail::reference_type(typename allocator_traits::is_stateful{}, - is_shared_allocator{}))>; + decltype(detail::reference_type(typename allocator_traits< + RawAllocator>::is_stateful{}, + is_shared_allocator{}))>; public: using allocator_type = typename allocator_traits::allocator_type; @@ -580,7 +581,7 @@ namespace wpi /// @{ /// \effects Copies the \c allocator_reference object. /// Only copies the pointer to it in the stateful case. - reference_storage(const reference_storage&) noexcept = default; + reference_storage(const reference_storage&) noexcept = default; reference_storage& operator=(const reference_storage&) noexcept = default; /// @} @@ -795,9 +796,9 @@ namespace wpi : public base_allocator, private detail::reference_storage_impl< typename allocator_traits::allocator_type, - decltype( - detail::reference_type(typename allocator_traits::is_stateful{}, - is_shared_allocator{}))> + decltype(detail::reference_type(typename allocator_traits< + RawAllocator>::is_stateful{}, + is_shared_allocator{}))> { using traits = allocator_traits; using composable = is_composable_allocator; @@ -805,7 +806,7 @@ namespace wpi typename allocator_traits::allocator_type, decltype(detail::reference_type(typename allocator_traits< RawAllocator>::is_stateful{}, - is_shared_allocator{}))>; + is_shared_allocator{}))>; public: // non stateful diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/allocator_traits.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/allocator_traits.hpp index 47b6ffb11a..0e23c638a2 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/allocator_traits.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/allocator_traits.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_ALLOCATOR_TRAITS_HPP_INCLUDED #define WPI_MEMORY_ALLOCATOR_TRAITS_HPP_INCLUDED @@ -375,12 +374,12 @@ namespace wpi template struct has_invalid_alloc_function - : std::is_same::allocator_type&>(), - 0, 0)), - traits_detail::error> + : std::is_same< + decltype(traits_detail::allocate_node(traits_detail::full_concept{}, + std::declval::allocator_type&>(), + 0, 0)), + traits_detail::error> { }; @@ -564,13 +563,12 @@ namespace wpi template struct has_invalid_try_dealloc_function - : std::is_same< - decltype( - traits_detail::try_deallocate_node(traits_detail::full_concept{}, - std::declval::allocator_type&>(), - nullptr, 0, 0)), - traits_detail::error> + : std::is_same::allocator_type&>(), + nullptr, 0, 0)), + traits_detail::error> { }; diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/config.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/config.hpp index 067ecd2909..40681bd8bc 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/config.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/config.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib /// \file /// Configuration macros. @@ -140,7 +139,7 @@ /// Set to `1` to disable automatic lifetime managment of the per-thread stack, /// requires managing it through the \ref wpi::memory::temporary_stack_initializer. /// Set to `0` to disable the per-thread stack completely. -/// \ref get_temporary_stack() will abort the program upon call. +/// \ref wpi::memory::get_temporary_stack() will abort the program upon call. /// \ingroup allocator #define WPI_MEMORY_TEMPORARY_STACK_MODE 2 #endif diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/container.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/container.hpp index fd1547f718..8f8eee563a 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/container.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/container.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_CONTAINER_HPP_INCLUDED #define WPI_MEMORY_CONTAINER_HPP_INCLUDED @@ -276,8 +275,9 @@ namespace wpi /// @{ /// Contains the node size of a node based STL container with a specific type. - /// These classes are auto-generated and only available if the tools are build and without - /// cross-compiling. + /// + /// This trait is auto-generated and may not be available depending on the build configuration, + /// especially when doing cross compilation. template struct forward_list_node_size : std::integral_constant { @@ -314,25 +314,30 @@ namespace wpi { }; - /// \copydoc forward_list_node_size + /// Contains the node size of a node based STL container with a specific type. + /// + /// This trait is auto-generated and may not be available depending on the build configuration, + /// especially when doing cross compilation. + /// + /// \notes `T` is always the `value_type` of the container, e.g. `std::pair`. template struct map_node_size : std::integral_constant { }; - /// \copydoc forward_list_node_size + /// \copydoc map_node_size template struct multimap_node_size : std::integral_constant { }; - /// \copydoc forward_list_node_size + /// \copydoc map_node_size template struct unordered_map_node_size : std::integral_constant { }; - /// \copydoc forward_list_node_size + /// \copydoc map_node_size template struct unordered_multimap_node_size : std::integral_constant diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/debugging.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/debugging.hpp index b04050f1a1..580696a906 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/debugging.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/debugging.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_DEBUGGING_HPP_INCLUDED #define WPI_MEMORY_DEBUGGING_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/default_allocator.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/default_allocator.hpp index 107a641c11..4d78abb666 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/default_allocator.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/default_allocator.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_DEFAULT_ALLOCATOR_HPP_INCLUDED #define WPI_MEMORY_DEFAULT_ALLOCATOR_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/deleter.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/deleter.hpp index 01c967c254..dd0298bfc3 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/deleter.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/deleter.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_DELETER_HPP_INCLUDED #define WPI_MEMORY_DELETER_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/align.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/align.hpp index 99d6bcc526..5a06340168 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/align.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/align.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_DETAIL_ALIGN_HPP_INCLUDED #define WPI_MEMORY_DETAIL_ALIGN_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/assert.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/assert.hpp index b8a73722b6..620d07bd60 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/assert.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/assert.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_DETAIL_ASSERT_HPP_INCLUDED #define WPI_MEMORY_DETAIL_ASSERT_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/container_node_sizes.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/container_node_sizes.hpp index 37949ca4e1..34d6d65dd1 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/container_node_sizes.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/container_node_sizes.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_DETAIL_CONTAINER_NODE_SIZES_HPP_INCLUDED #define WPI_MEMORY_DETAIL_CONTAINER_NODE_SIZES_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/debug_helpers.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/debug_helpers.hpp index 3ef2eed85c..1decb72f4b 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/debug_helpers.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/debug_helpers.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_DEBUG_HELPERS_HPP_INCLUDED #define WPI_MEMORY_DEBUG_HELPERS_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/ebo_storage.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/ebo_storage.hpp index de53f7fc3d..640d8449be 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/ebo_storage.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/ebo_storage.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_DETAIL_EBO_STORAGE_HPP_INCLUDED #define WPI_MEMORY_DETAIL_EBO_STORAGE_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/free_list.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/free_list.hpp index 612706d3bc..4c913247df 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/free_list.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/free_list.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_DETAILL_FREE_LIST_HPP_INCLUDED #define WPI_MEMORY_DETAILL_FREE_LIST_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/free_list_array.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/free_list_array.hpp index ec57e1e9e3..17cd1fa5eb 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/free_list_array.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/free_list_array.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_DETAIL_FREE_LIST_ARRAY_HPP #define WPI_MEMORY_DETAIL_FREE_LIST_ARRAY_HPP diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/ilog2.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/ilog2.hpp index 5cf125a4eb..eb4e4f310b 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/ilog2.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/ilog2.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_DETAIL_ILOG2_HPP_INCLUDED #define WPI_MEMORY_DETAIL_ILOG2_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/lowlevel_allocator.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/lowlevel_allocator.hpp index 2ac45a5a4e..beb8c364b6 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/lowlevel_allocator.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/lowlevel_allocator.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_DETAIL_LOWLEVEL_ALLOCATOR_HPP_INCLUDED #define WPI_MEMORY_DETAIL_LOWLEVEL_ALLOCATOR_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/memory_stack.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/memory_stack.hpp index e49d480685..3d38dba505 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/memory_stack.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/memory_stack.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_DETAIL_MEMORY_STACK_HPP_INCLUDED #define WPI_MEMORY_DETAIL_MEMORY_STACK_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/small_free_list.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/small_free_list.hpp index 682417da38..1ea31fc8f8 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/small_free_list.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/small_free_list.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_DETAIL_SMALL_FREE_LIST_HPP_INCLUDED #define WPI_MEMORY_DETAIL_SMALL_FREE_LIST_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/utility.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/utility.hpp index c746fa2263..b33aa16b14 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/utility.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/detail/utility.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_DETAIL_UTILITY_HPP #define WPI_MEMORY_DETAIL_UTILITY_HPP diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/error.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/error.hpp index 5ff99cfda0..3d2f2fae37 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/error.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/error.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib /// \file /// The exception classes. diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/fallback_allocator.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/fallback_allocator.hpp index 3bf530e318..456e84e44a 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/fallback_allocator.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/fallback_allocator.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_FALLBACK_ALLOCATOR_HPP_INCLUDED #define WPI_MEMORY_FALLBACK_ALLOCATOR_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/heap_allocator.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/heap_allocator.hpp index 072493723e..803a70598f 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/heap_allocator.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/heap_allocator.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_HEAP_ALLOCATOR_HPP_INCLUDED #define WPI_MEMORY_HEAP_ALLOCATOR_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/iteration_allocator.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/iteration_allocator.hpp index d35a927f65..fafb72cf1f 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/iteration_allocator.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/iteration_allocator.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_ITERATION_ALLOCATOR_HPP_INCLUDED #define WPI_MEMORY_ITERATION_ALLOCATOR_HPP_INCLUDED @@ -77,8 +76,8 @@ namespace wpi iteration_allocator& operator=(iteration_allocator&& other) noexcept { allocator_type::operator=(detail::move(other)); - block_ = other.block_; - cur_ = other.cur_; + block_ = other.block_; + cur_ = other.cur_; for (auto i = 0u; i != N; ++i) stacks_[i] = detail::move(other.stacks_[i]); diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/joint_allocator.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/joint_allocator.hpp index db67d46b7a..540bbd1592 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/joint_allocator.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/joint_allocator.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_JOINT_ALLOCATOR_HPP_INCLUDED #define WPI_MEMORY_JOINT_ALLOCATOR_HPP_INCLUDED @@ -515,7 +514,7 @@ namespace wpi { } - joint_allocator(const joint_allocator& other) noexcept = default; + joint_allocator(const joint_allocator& other) noexcept = default; joint_allocator& operator=(const joint_allocator& other) noexcept = default; /// \effects Allocates a node with given properties. @@ -709,7 +708,7 @@ namespace wpi } joint_array& operator=(const joint_array&) = delete; - joint_array& operator=(joint_array&&) = delete; + joint_array& operator=(joint_array&&) = delete; //=== accessors ===// /// @{ @@ -810,7 +809,7 @@ namespace wpi stack_->unwind(objects_); } - builder(builder&&) = delete; + builder(builder&&) = delete; builder& operator=(builder&&) = delete; template diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/malloc_allocator.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/malloc_allocator.hpp index 3be9820e42..a5da1f4d49 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/malloc_allocator.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/malloc_allocator.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_MALLOC_ALLOCATOR_HPP_INCLUDED #define WPI_MEMORY_MALLOC_ALLOCATOR_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_arena.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_arena.hpp index a6349930e5..c4469e863f 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_arena.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_arena.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_MEMORY_ARENA_HPP_INCLUDED #define WPI_MEMORY_MEMORY_ARENA_HPP_INCLUDED @@ -548,7 +547,7 @@ namespace wpi if (block_size_) { auto mem = traits::allocate_array(get_allocator(), block_size_, 1, - detail::max_alignment); + detail::max_alignment); memory_block block(mem, block_size_); block_size_ = 0u; return block; diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_pool.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_pool.hpp index 09c2b66f00..282368663b 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_pool.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_pool.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_MEMORY_POOL_HPP_INCLUDED #define WPI_MEMORY_MEMORY_POOL_HPP_INCLUDED @@ -103,8 +102,8 @@ namespace wpi memory_pool& operator=(memory_pool&& other) noexcept { leak_checker::operator=(detail::move(other)); - arena_ = detail::move(other.arena_); - free_list_ = detail::move(other.free_list_); + arena_ = detail::move(other.arena_); + free_list_ = detail::move(other.free_list_); return *this; } /// @} diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_pool_collection.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_pool_collection.hpp index 294dd0a81f..0bd02487bc 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_pool_collection.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_pool_collection.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_MEMORY_POOL_COLLECTION_HPP_INCLUDED #define WPI_MEMORY_MEMORY_POOL_COLLECTION_HPP_INCLUDED @@ -76,8 +75,7 @@ namespace wpi /// the size of the initial memory block and other constructor arguments for the \concept{concept_blockallocator,BlockAllocator}. /// The \c BucketDistribution controls how many free lists are created, /// but unlike in \ref memory_pool all free lists are initially empty and the first memory block queued. - /// \requires \c max_node_size must be a valid \concept{concept_node,node} size - /// and \c block_size must be non-zero. + /// \requires \c block_size must be non-zero and \c max_node_size must be a valid \concept{concept_node,node} size and smaller than \c block_size divided by the number of pools. template memory_pool_collection(std::size_t max_node_size, std::size_t block_size, Args&&... args) @@ -85,6 +83,7 @@ namespace wpi stack_(allocate_block()), pools_(stack_, block_end(), max_node_size) { + detail::check_allocation_size(max_node_size, def_capacity(), info()); } /// \effects Destroys the \ref memory_pool_collection by returning all memory blocks, @@ -107,9 +106,9 @@ namespace wpi memory_pool_collection& operator=(memory_pool_collection&& other) noexcept { leak_checker::operator=(detail::move(other)); - arena_ = detail::move(other.arena_); - stack_ = detail::move(other.stack_); - pools_ = detail::move(other.pools_); + arena_ = detail::move(other.arena_); + stack_ = detail::move(other.stack_); + pools_ = detail::move(other.pools_); return *this; } /// @} diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_pool_type.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_pool_type.hpp index a7c8ff838c..7ebe4a51d7 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_pool_type.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_pool_type.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_MEMORY_POOL_TYPE_HPP_INCLUDED #define WPI_MEMORY_MEMORY_POOL_TYPE_HPP_INCLUDED @@ -28,7 +27,7 @@ namespace wpi }; /// Tag type defining a memory pool optimized for arrays. - /// It keeps the nodes oredered inside the free list and searches the list for an appropriate memory block. + /// It keeps the nodes ordered inside the free list and searches the list for an appropriate memory block. /// Array allocations are still pretty slow, if the array gets big enough it can get slower than \c new. /// Node allocations are still fast, unless there is deallocation in random order. /// \note Use this tag type only if you really need to have a memory pool! diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_resource_adapter.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_resource_adapter.hpp index e805f9b79e..8428bb24d0 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_resource_adapter.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_resource_adapter.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_MEMORY_RESOURCE_ADAPTER_HPP_INCLUDED #define WPI_MEMORY_MEMORY_RESOURCE_ADAPTER_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_stack.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_stack.hpp index 4c9f524b50..0c9d8962a2 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_stack.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/memory_stack.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_MEMORY_STACK_HPP_INCLUDED #define WPI_MEMORY_MEMORY_STACK_HPP_INCLUDED @@ -203,7 +202,8 @@ namespace wpi arena_.deallocate_block(); detail::debug_check_pointer( - [&] { + [&] + { auto cur = arena_.current_block(); return m.end == static_cast(cur.memory) + cur.size; }, diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/namespace_alias.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/namespace_alias.hpp index bf2b95d52f..4af20c1487 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/namespace_alias.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/namespace_alias.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_NAMESPACE_ALIAS_HPP_INCLUDED #define WPI_MEMORY_NAMESPACE_ALIAS_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/new_allocator.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/new_allocator.hpp index 8e24f2f3b4..0beec00a3c 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/new_allocator.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/new_allocator.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_NEW_ALLOCATOR_HPP_INCLUDED #define WPI_MEMORY_NEW_ALLOCATOR_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/segregator.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/segregator.hpp index fcd02ac359..ae06f830f9 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/segregator.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/segregator.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_SEGREGATOR_HPP_INCLUDED #define WPI_MEMORY_SEGREGATOR_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/smart_ptr.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/smart_ptr.hpp index 877efd7222..016f31be77 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/smart_ptr.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/smart_ptr.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_SMART_PTR_HPP_INCLUDED #define WPI_MEMORY_SMART_PTR_HPP_INCLUDED @@ -192,18 +191,6 @@ namespace wpi detail::forward(alloc)), detail::forward(args)...); } - -#if !defined(DOXYGEN) -#include "detail/container_node_sizes.hpp" -#else - /// Contains the node size needed for a `std::shared_ptr`. - /// These classes are auto-generated and only available if the tools are build and without cross-compiling. - /// \ingroup adapter - template - struct shared_ptr_node_size : std::integral_constant - { - }; -#endif } // namespace memory } // namespace wpi diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/static_allocator.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/static_allocator.hpp index efbbf73d4d..33242f9013 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/static_allocator.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/static_allocator.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_STATIC_ALLOCATOR_HPP_INCLUDED #define WPI_MEMORY_STATIC_ALLOCATOR_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/std_allocator.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/std_allocator.hpp index f727a1c390..18262eb512 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/std_allocator.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/std_allocator.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_STD_ALLOCATOR_HPP_INCLUDED #define WPI_MEMORY_STD_ALLOCATOR_HPP_INCLUDED @@ -134,7 +133,8 @@ namespace wpi // MSVC seems to ignore access rights in decltype SFINAE below // use this to prevent this constructor being chosen instead of move/copy for types inheriting from it WPI_REQUIRES((!std::is_base_of::value))> - std_allocator(RawAlloc& alloc, WPI_SFINAE(alloc_reference(alloc))) noexcept + std_allocator(RawAlloc& alloc, + WPI_SFINAE(alloc_reference(std::declval()))) noexcept : alloc_reference(alloc) { } @@ -149,7 +149,8 @@ namespace wpi // MSVC seems to ignore access rights in decltype SFINAE below // use this to prevent this constructor being chosen instead of move/copy for types inheriting from it WPI_REQUIRES((!std::is_base_of::value))> - std_allocator(const RawAlloc& alloc, WPI_SFINAE(alloc_reference(alloc))) noexcept + std_allocator(const RawAlloc& alloc, WPI_SFINAE(alloc_reference( + std::declval()))) noexcept : alloc_reference(alloc) { } diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/temporary_allocator.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/temporary_allocator.hpp index 7eba76faca..6d5d73f1d3 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/temporary_allocator.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/temporary_allocator.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_TEMPORARY_ALLOCATOR_HPP_INCLUDED #define WPI_MEMORY_TEMPORARY_ALLOCATOR_HPP_INCLUDED @@ -195,7 +194,7 @@ namespace wpi /// \effects Destroys the per-thread stack if it isn't already destroyed. ~temporary_stack_initializer() noexcept; - temporary_stack_initializer(temporary_stack_initializer&&) = delete; + temporary_stack_initializer(temporary_stack_initializer&&) = delete; temporary_stack_initializer& operator=(temporary_stack_initializer&&) = delete; }; @@ -229,7 +228,7 @@ namespace wpi ~temporary_allocator() noexcept; - temporary_allocator(temporary_allocator&&) = delete; + temporary_allocator(temporary_allocator&&) = delete; temporary_allocator& operator=(temporary_allocator&&) = delete; /// \effects Allocates memory from the internal \ref memory_stack by forwarding to it. diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/threading.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/threading.hpp index 0314ea43ff..82629ec7b7 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/threading.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/threading.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_THREADING_HPP_INCLUDED #define WPI_MEMORY_THREADING_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/tracking.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/tracking.hpp index ccbc343afa..4742a4cef4 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/tracking.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/tracking.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_TRACKING_HPP_INCLUDED #define WPI_MEMORY_TRACKING_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/virtual_memory.hpp b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/virtual_memory.hpp index 33d82f7628..360ca78f4b 100644 --- a/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/virtual_memory.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/include/wpi/memory/virtual_memory.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_VIRTUAL_MEMORY_HPP_INCLUDED #define WPI_MEMORY_VIRTUAL_MEMORY_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/src/debugging.cpp b/wpiutil/src/main/native/thirdparty/memory/src/debugging.cpp index be1b0333d2..f3ab89c151 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/debugging.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/debugging.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/debugging.hpp" diff --git a/wpiutil/src/main/native/thirdparty/memory/src/detail/align.cpp b/wpiutil/src/main/native/thirdparty/memory/src/detail/align.cpp index e1c4f2ab95..920e13f953 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/detail/align.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/detail/align.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/detail/align.hpp" diff --git a/wpiutil/src/main/native/thirdparty/memory/src/detail/assert.cpp b/wpiutil/src/main/native/thirdparty/memory/src/detail/assert.cpp index 497f7f8a22..d1d9028de1 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/detail/assert.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/detail/assert.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/detail/assert.hpp" diff --git a/wpiutil/src/main/native/thirdparty/memory/src/detail/debug_helpers.cpp b/wpiutil/src/main/native/thirdparty/memory/src/detail/debug_helpers.cpp index b5afb202d7..405c85f800 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/detail/debug_helpers.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/detail/debug_helpers.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/detail/debug_helpers.hpp" diff --git a/wpiutil/src/main/native/thirdparty/memory/src/detail/free_list.cpp b/wpiutil/src/main/native/thirdparty/memory/src/detail/free_list.cpp index 2ca703476c..5ac3950d2b 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/detail/free_list.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/detail/free_list.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/detail/free_list.hpp" diff --git a/wpiutil/src/main/native/thirdparty/memory/src/detail/free_list_array.cpp b/wpiutil/src/main/native/thirdparty/memory/src/detail/free_list_array.cpp index f4658da29c..3a103f57c5 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/detail/free_list_array.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/detail/free_list_array.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/detail/free_list_array.hpp" diff --git a/wpiutil/src/main/native/thirdparty/memory/src/detail/free_list_utils.hpp b/wpiutil/src/main/native/thirdparty/memory/src/detail/free_list_utils.hpp index a75283722a..106e129834 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/detail/free_list_utils.hpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/detail/free_list_utils.hpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #ifndef WPI_MEMORY_SRC_DETAIL_FREE_LIST_UTILS_HPP_INCLUDED #define WPI_MEMORY_SRC_DETAIL_FREE_LIST_UTILS_HPP_INCLUDED diff --git a/wpiutil/src/main/native/thirdparty/memory/src/detail/small_free_list.cpp b/wpiutil/src/main/native/thirdparty/memory/src/detail/small_free_list.cpp index 3508daa973..08be31210e 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/detail/small_free_list.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/detail/small_free_list.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/detail/small_free_list.hpp" diff --git a/wpiutil/src/main/native/thirdparty/memory/src/error.cpp b/wpiutil/src/main/native/thirdparty/memory/src/error.cpp index 6261819d1e..f5ef53ca11 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/error.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/error.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/error.hpp" diff --git a/wpiutil/src/main/native/thirdparty/memory/src/heap_allocator.cpp b/wpiutil/src/main/native/thirdparty/memory/src/heap_allocator.cpp index 0f559bd31f..32d12362e8 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/heap_allocator.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/heap_allocator.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/heap_allocator.hpp" diff --git a/wpiutil/src/main/native/thirdparty/memory/src/iteration_allocator.cpp b/wpiutil/src/main/native/thirdparty/memory/src/iteration_allocator.cpp index c174c132c2..411eba6cff 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/iteration_allocator.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/iteration_allocator.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/iteration_allocator.hpp" diff --git a/wpiutil/src/main/native/thirdparty/memory/src/malloc_allocator.cpp b/wpiutil/src/main/native/thirdparty/memory/src/malloc_allocator.cpp index f54817aaec..f5783c7844 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/malloc_allocator.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/malloc_allocator.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/config.hpp" #if WPI_HOSTED_IMPLEMENTATION diff --git a/wpiutil/src/main/native/thirdparty/memory/src/memory_arena.cpp b/wpiutil/src/main/native/thirdparty/memory/src/memory_arena.cpp index d8454bef55..148ed3196b 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/memory_arena.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/memory_arena.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/memory_arena.hpp" @@ -42,7 +41,7 @@ bool memory_block_stack::owns(const void* ptr) const noexcept auto address = static_cast(ptr); for (auto cur = head_; cur; cur = cur->prev) { - auto mem = static_cast(static_cast(cur)); + auto mem = static_cast(static_cast(cur)) + implementation_offset(); if (address >= mem && address < mem + cur->usable_size) return true; } diff --git a/wpiutil/src/main/native/thirdparty/memory/src/memory_pool.cpp b/wpiutil/src/main/native/thirdparty/memory/src/memory_pool.cpp index 5a5e5ab463..47951be187 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/memory_pool.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/memory_pool.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/memory_pool.hpp" diff --git a/wpiutil/src/main/native/thirdparty/memory/src/memory_pool_collection.cpp b/wpiutil/src/main/native/thirdparty/memory/src/memory_pool_collection.cpp index 636681180d..550f740814 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/memory_pool_collection.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/memory_pool_collection.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/memory_pool_collection.hpp" diff --git a/wpiutil/src/main/native/thirdparty/memory/src/memory_stack.cpp b/wpiutil/src/main/native/thirdparty/memory/src/memory_stack.cpp index 8db5728b17..753cfe52d4 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/memory_stack.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/memory_stack.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/memory_stack.hpp" diff --git a/wpiutil/src/main/native/thirdparty/memory/src/new_allocator.cpp b/wpiutil/src/main/native/thirdparty/memory/src/new_allocator.cpp index 27911820ef..d23edf5a04 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/new_allocator.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/new_allocator.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/new_allocator.hpp" diff --git a/wpiutil/src/main/native/thirdparty/memory/src/static_allocator.cpp b/wpiutil/src/main/native/thirdparty/memory/src/static_allocator.cpp index 15a88bf443..fbc12cc924 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/static_allocator.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/static_allocator.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/static_allocator.hpp" @@ -38,9 +37,9 @@ memory_block static_block_allocator::allocate_block() void static_block_allocator::deallocate_block(memory_block block) noexcept { - detail:: - debug_check_pointer([&] { return static_cast(block.memory) + block.size == cur_; }, - info(), block.memory); + detail::debug_check_pointer([&] + { return static_cast(block.memory) + block.size == cur_; }, + info(), block.memory); cur_ -= block_size_; } diff --git a/wpiutil/src/main/native/thirdparty/memory/src/temporary_allocator.cpp b/wpiutil/src/main/native/thirdparty/memory/src/temporary_allocator.cpp index fa85e99f5f..de4d7ed8f4 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/temporary_allocator.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/temporary_allocator.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/temporary_allocator.hpp" @@ -216,9 +215,8 @@ temporary_stack& wpi::memory::get_temporary_stack(std::size_t initial_size) namespace { - WPI_THREAD_LOCAL alignas( - temporary_stack) char temporary_stack_storage[sizeof(temporary_stack)]; - WPI_THREAD_LOCAL bool is_created = false; + thread_local alignas(temporary_stack) char temporary_stack_storage[sizeof(temporary_stack)]; + thread_local bool is_created = false; temporary_stack& get() noexcept { diff --git a/wpiutil/src/main/native/thirdparty/memory/src/virtual_memory.cpp b/wpiutil/src/main/native/thirdparty/memory/src/virtual_memory.cpp index fd7960f479..1f548121f1 100644 --- a/wpiutil/src/main/native/thirdparty/memory/src/virtual_memory.cpp +++ b/wpiutil/src/main/native/thirdparty/memory/src/virtual_memory.cpp @@ -1,6 +1,5 @@ -// Copyright (C) 2015-2021 Müller -// This file is subject to the license terms in the LICENSE file -// found in the top-level directory of this distribution. +// Copyright (C) 2015-2023 Jonathan Müller and foonathan/memory contributors +// SPDX-License-Identifier: Zlib #include "wpi/memory/virtual_memory.hpp"