diff --git a/upstream_utils/update_memory.py b/upstream_utils/update_memory.py index e72717a792f..6645aaf60cf 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 8118ec48277..3083a4029e0 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 8dab2e0b86e..dc9067222a1 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 47b6ffb11aa..0e23c638a21 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 067ecd29091..40681bd8bca 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 fd1547f7188..8f8eee563a9 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 b04050f1a16..580696a906f 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 107a641c11c..4d78abb666d 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 01c967c254d..dd0298bfc31 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 99d6bcc5263..5a06340168f 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 b8a73722b6a..620d07bd60f 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 37949ca4e12..34d6d65dd14 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 3ef2eed85c9..1decb72f4b6 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 de53f7fc3d7..640d8449bee 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 612706d3bc1..4c913247df7 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 ec57e1e9e3d..17cd1fa5eb4 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 5cf125a4eb9..eb4e4f310b4 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 2ac45a5a4ee..beb8c364b6e 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 e49d480685b..3d38dba5052 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 682417da38e..1ea31fc8f83 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 c746fa2263b..b33aa16b145 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 5ff99cfda0c..3d2f2fae37b 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 3bf530e3180..456e84e44a0 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 072493723e2..803a70598f1 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 d35a927f655..fafb72cf1f8 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 db67d46b7aa..540bbd1592e 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 3be9820e423..a5da1f4d494 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 a6349930e5c..c4469e863fa 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 09c2b66f00a..282368663b8 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 294dd0a81fa..0bd02487bc9 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 a7c8ff838cf..7ebe4a51d70 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 e805f9b79e1..8428bb24d09 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 4c9f524b506..0c9d8962a25 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 bf2b95d52fa..4af20c14875 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 8e24f2f3b45..0beec00a3c7 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 fcd02ac359e..ae06f830f9a 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 877efd72229..016f31be77c 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 efbbf73d4dc..33242f9013d 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 f727a1c3904..18262eb5124 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 7eba76faca7..6d5d73f1d35 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 0314ea43ff4..82629ec7b7e 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 ccbc343afaa..4742a4cef42 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 33d82f76281..360ca78f4bb 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 be1b0333d27..f3ab89c1514 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 e1c4f2ab954..920e13f9539 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 497f7f8a22d..d1d9028de17 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 b5afb202d78..405c85f8002 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 2ca703476cc..5ac3950d2b5 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 f4658da29c3..3a103f57c50 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 a75283722af..106e1298342 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 3508daa9732..08be31210eb 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 6261819d1ef..f5ef53ca11c 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 0f559bd31fb..32d12362e89 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 c174c132c23..411eba6cff4 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 f54817aaec0..f5783c7844b 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 d8454bef551..148ed3196b8 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 5a5e5ab4638..47951be187d 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 636681180d0..550f7408148 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 8db5728b17d..753cfe52d42 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 27911820ef3..d23edf5a042 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 15a88bf443b..fbc12cc924f 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 fa85e99f5f6..de4d7ed8f4e 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 fd7960f4795..1f548121f1e 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"