summaryrefslogtreecommitdiff
path: root/mm/include
diff options
context:
space:
mode:
authorEblo <7004497+Eblo@users.noreply.github.com>2025-10-26 11:34:29 -0400
committerGitHub <noreply@github.com>2025-10-26 11:34:29 -0400
commitfb5064a0607b80b3b7ab28336d80485a71f92e05 (patch)
tree09c8e01d2befe7f39725bf1cbcecc07aafbf8784 /mm/include
parente180e4666c06dc0d75d9d4bd247815184b9317cc (diff)
Remove boost dependency (#1298)
* Remove boost dependency * Convert check pools to vectors * Convert checks and region collections to ordered
Diffstat (limited to 'mm/include')
-rw-r--r--mm/include/boost_custom/container_hash/detail/hash_mix_32.hpp47
-rw-r--r--mm/include/boost_custom/container_hash/detail/hash_range_32.hpp128
-rw-r--r--mm/include/boost_custom/container_hash/hash_32.hpp188
-rw-r--r--mm/include/boost_custom/container_hash/hash_fwd_32.hpp25
-rw-r--r--mm/include/boost_custom/container_hash/version.hpp11
5 files changed, 0 insertions, 399 deletions
diff --git a/mm/include/boost_custom/container_hash/detail/hash_mix_32.hpp b/mm/include/boost_custom/container_hash/detail/hash_mix_32.hpp
deleted file mode 100644
index 95cfdcd77..000000000
--- a/mm/include/boost_custom/container_hash/detail/hash_mix_32.hpp
+++ /dev/null
@@ -1,47 +0,0 @@
-// 32 bit implementation based off of Boost hash
-
-#ifndef BOOST_HASH_DETAIL_HASH_MIX_32_HPP
-#define BOOST_HASH_DETAIL_HASH_MIX_32_HPP
-
-#include <boost/cstdint.hpp>
-#include <cstddef>
-#include <climits>
-
-namespace boost
-{
-namespace hash_detail
-{
-
-template<uint32_t Bits> struct hash_mix_impl_32;
-
-// hash_mix for 32 bit
-//
-// We use the "best xmxmx" implementation from
-// https://github.com/skeeto/hash-prospector/issues/19
-
-template<> struct hash_mix_impl_32<32>
-{
- inline static boost::uint32_t fn( boost::uint32_t x )
- {
- boost::uint32_t const m1 = 0x21f0aaad;
- boost::uint32_t const m2 = 0x735a2d97;
-
- x ^= x >> 16;
- x *= m1;
- x ^= x >> 15;
- x *= m2;
- x ^= x >> 15;
-
- return x;
- }
-};
-
-inline uint32_t hash_mix_32( uint32_t v )
-{
- return hash_mix_impl_32<32>::fn( v );
-}
-
-} // namespace hash_detail
-} // namespace boost
-
-#endif // #ifndef BOOST_HASH_DETAIL_HASH_MIX_32_HPP
diff --git a/mm/include/boost_custom/container_hash/detail/hash_range_32.hpp b/mm/include/boost_custom/container_hash/detail/hash_range_32.hpp
deleted file mode 100644
index cfa0a2a2d..000000000
--- a/mm/include/boost_custom/container_hash/detail/hash_range_32.hpp
+++ /dev/null
@@ -1,128 +0,0 @@
-// 32 bit implementation based off of Boost hash
-// Only implementing 32 bit version of char based ranges
-
-#ifndef BOOST_HASH_DETAIL_HASH_RANGE_32_HPP
-#define BOOST_HASH_DETAIL_HASH_RANGE_32_HPP
-
-#include <boost_custom/container_hash/hash_fwd_32.hpp>
-#include <boost_custom/container_hash/version.hpp>
-
-#if BOOST_VERSION_HAS_HASH_RANGE
-#include <boost/container_hash/detail/hash_range.hpp>
-#else
-#include <boost/type_traits/integral_constant.hpp>
-#include <boost/type_traits/enable_if.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/cstdint.hpp>
-#include <cstddef>
-#include <climits>
-#include <iterator>
-#endif // #if BOOST_VERSION_HAS_HASH_RANGE
-
-namespace boost
-{
-namespace hash_detail
-{
-
-#if !BOOST_VERSION_HAS_HASH_RANGE
-
-template<class T> struct is_char_type: public boost::false_type {};
-
-#if CHAR_BIT == 8
-
-template<> struct is_char_type<char>: public boost::true_type {};
-template<> struct is_char_type<signed char>: public boost::true_type {};
-template<> struct is_char_type<unsigned char>: public boost::true_type {};
-
-#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
-template<> struct is_char_type<char8_t>: public boost::true_type {};
-#endif
-
-#if defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603L
-template<> struct is_char_type<std::byte>: public boost::true_type {};
-#endif
-
-#endif
-
-#endif // #if !BOOST_VERSION_HAS_HASH_RANGE
-
-#if BOOST_USE_STD_TYPES
-#define BOOST_ENABLE_IF std::enable_if
-#define BOOST_IS_SAME std::is_same
-#else
-#define BOOST_ENABLE_IF boost::enable_if_
-#define BOOST_IS_SAME is_same
-#endif
-
-template<class It>
-inline typename BOOST_ENABLE_IF<
- is_char_type<typename std::iterator_traits<It>::value_type>::value &&
- BOOST_IS_SAME<typename std::iterator_traits<It>::iterator_category, std::random_access_iterator_tag>::value,
-std::size_t>::type
- hash_range_32( uint32_t seed, It first, It last )
-{
- std::size_t n = static_cast<std::size_t>( last - first );
-
- for( ; n >= 4; first += 4, n -= 4 )
- {
- // clang 5+, gcc 5+ figure out this pattern and use a single mov on x86
- // gcc on s390x and power BE even knows how to use load-reverse
-
- boost::uint32_t w =
- static_cast<boost::uint32_t>( static_cast<unsigned char>( first[0] ) ) |
- static_cast<boost::uint32_t>( static_cast<unsigned char>( first[1] ) ) << 8 |
- static_cast<boost::uint32_t>( static_cast<unsigned char>( first[2] ) ) << 16 |
- static_cast<boost::uint32_t>( static_cast<unsigned char>( first[3] ) ) << 24;
-
- hash_combine_32( seed, w );
- }
-
- {
- // add a trailing suffix byte of 0x01 because otherwise sequences of
- // trailing zeroes are indistinguishable from end of string
-
- boost::uint32_t w = 0x01u;
-
- switch( n )
- {
- case 1:
-
- w =
- static_cast<boost::uint32_t>( static_cast<unsigned char>( first[0] ) ) |
- 0x0100u;
-
- break;
-
- case 2:
-
- w =
- static_cast<boost::uint32_t>( static_cast<unsigned char>( first[0] ) ) |
- static_cast<boost::uint32_t>( static_cast<unsigned char>( first[1] ) ) << 8 |
- 0x010000u;
-
- break;
-
- case 3:
-
- w =
- static_cast<boost::uint32_t>( static_cast<unsigned char>( first[0] ) ) |
- static_cast<boost::uint32_t>( static_cast<unsigned char>( first[1] ) ) << 8 |
- static_cast<boost::uint32_t>( static_cast<unsigned char>( first[2] ) ) << 16 |
- 0x01000000u;
-
- break;
- }
-
- hash_combine_32( seed, w );
- }
-
- return seed;
-}
-
-} // namespace hash_detail
-} // namespace boost
-
-#undef BOOST_ENABLE_IF
-#undef BOOST_IS_SAME
-
-#endif // #ifndef BOOST_HASH_DETAIL_HASH_RANGE_32_HPP
diff --git a/mm/include/boost_custom/container_hash/hash_32.hpp b/mm/include/boost_custom/container_hash/hash_32.hpp
deleted file mode 100644
index eaf459a34..000000000
--- a/mm/include/boost_custom/container_hash/hash_32.hpp
+++ /dev/null
@@ -1,188 +0,0 @@
-// 32 bit implementation based off of Boost hash
-// Only implementing 32 bit versions integral and string based hashes
-
-#ifndef BOOST_FUNCTIONAL_HASH_HASH_32_HPP
-#define BOOST_FUNCTIONAL_HASH_HASH_32_HPP
-
-#include <boost/container_hash/hash.hpp>
-#include <boost_custom/container_hash/hash_fwd_32.hpp>
-#include <boost_custom/container_hash/detail/hash_mix_32.hpp>
-#include <boost_custom/container_hash/detail/hash_range_32.hpp>
-#include <boost_custom/container_hash/version.hpp>
-
-#if !BOOST_VERSION_HAS_HASH_RANGE
-#include <boost/type_traits/is_unsigned.hpp>
-#include <boost/type_traits/make_unsigned.hpp>
-
-#if BOOST_WORKAROUND(__GNUC__, < 3) \
- && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
-#define BOOST_HASH_CHAR_TRAITS string_char_traits
-#else
-#define BOOST_HASH_CHAR_TRAITS char_traits
-#endif
-
-#endif // #if !BOOST_VERSION_HAS_HASH_RANGE
-
-#if BOOST_USE_STD_TYPES
-#define BOOST_ENABLE_IF std::enable_if
-#define BOOST_IS_INTEGRAL hash_detail::is_integral
-#define BOOST_IS_UNSIGNED is_unsigned
-#define BOOST_MAKE_UNSIGNED make_unsigned
-#else
-#define BOOST_ENABLE_IF boost::enable_if_
-#define BOOST_IS_INTEGRAL boost::is_integral
-#define BOOST_IS_UNSIGNED boost::is_unsigned
-#define BOOST_MAKE_UNSIGNED boost::make_unsigned
-#endif
-
-namespace boost
-{
-
- //
- // boost::hash_value
- //
-
- // integral types
-
- namespace hash_detail
- {
- template<class T,
- bool bigger_than_size_t = (sizeof(T) > sizeof(uint32_t)),
- bool is_unsigned = BOOST_IS_UNSIGNED<T>::value,
- std::size_t size_t_bits = sizeof(uint32_t) * CHAR_BIT,
- std::size_t type_bits = sizeof(T) * CHAR_BIT>
- struct hash_integral_impl_32;
-
- template<class T, bool is_unsigned, std::size_t size_t_bits, std::size_t type_bits> struct hash_integral_impl_32<T, false, is_unsigned, size_t_bits, type_bits>
- {
- static uint32_t fn( T v )
- {
- return static_cast<uint32_t>( v );
- }
- };
-
- template<class T, std::size_t size_t_bits, std::size_t type_bits> struct hash_integral_impl_32<T, true, false, size_t_bits, type_bits>
- {
- static uint32_t fn( T v )
- {
- typedef typename BOOST_MAKE_UNSIGNED<T>::type U;
-
- if( v >= 0 )
- {
- return hash_integral_impl_32<U>::fn( static_cast<U>( v ) );
- }
- else
- {
- return ~hash_integral_impl_32<U>::fn( static_cast<U>( ~static_cast<U>( v ) ) );
- }
- }
- };
-
- template<class T> struct hash_integral_impl_32<T, true, true, 32, 64>
- {
- static uint32_t fn( T v )
- {
- uint32_t seed = 0;
-
- seed = static_cast<uint32_t>( v >> 32 ) + hash_detail::hash_mix_32( seed );
- seed = static_cast<uint32_t>( v ) + hash_detail::hash_mix_32( seed );
-
- return seed;
- }
- };
-
- template<class T> struct hash_integral_impl_32<T, true, true, 32, 128>
- {
- static uint32_t fn( T v )
- {
- uint32_t seed = 0;
-
- seed = static_cast<uint32_t>( v >> 96 ) + hash_detail::hash_mix_32( seed );
- seed = static_cast<uint32_t>( v >> 64 ) + hash_detail::hash_mix_32( seed );
- seed = static_cast<uint32_t>( v >> 32 ) + hash_detail::hash_mix_32( seed );
- seed = static_cast<uint32_t>( v ) + hash_detail::hash_mix_32( seed );
-
- return seed;
- }
- };
-
- } // namespace hash_detail
-
- template <typename T>
- typename BOOST_ENABLE_IF<BOOST_IS_INTEGRAL<T>::value, uint32_t>::type
- hash_value_32( T v )
- {
- return hash_detail::hash_integral_impl_32<T>::fn( v );
- }
-
- // contiguous ranges (string, vector, array)
-#if BOOST_VERSION_HAS_HASH_RANGE
- template <typename T>
- typename BOOST_ENABLE_IF<container_hash::is_contiguous_range<T>::value, uint32_t>::type
- hash_value_32( T const& v )
- {
- return boost::hash_range_32( v.data(), v.data() + v.size() );
- }
-#else
- template <class Ch, class A>
- inline uint32_t hash_value_32(
- std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const& v)
- {
- return boost::hash_range_32( v.data(), v.data() + v.size() );
- }
-#endif
-
- //
- // boost::hash_combine
- //
-
- template <class T>
- inline void hash_combine_32( uint32_t& seed, T const& v )
- {
- seed = boost::hash_detail::hash_mix_32( seed + 0x9e3779b9 + boost::hash_32<T>()( v ) );
- }
-
- //
- // boost::hash_range
- //
-
- template <class It>
- inline void hash_range_32( uint32_t& seed, It first, It last )
- {
- seed = hash_detail::hash_range_32( seed, first, last );
- }
-
- template <class It>
- inline uint32_t hash_range_32( It first, It last )
- {
- uint32_t seed = 0;
-
- hash_range_32( seed, first, last );
-
- return seed;
- }
-
- //
- // boost::hash
- //
-
- template <class T> struct hash_32
- {
- typedef T argument_type;
- typedef uint32_t result_type;
-
- uint32_t operator()( T const& val ) const
- {
- return hash_value_32( val );
- }
- };
-
-} // namespace boost
-
-#undef BOOST_HASH_CHAR_TRAITS
-#undef BOOST_ENABLE_IF
-#undef BOOST_IS_INTEGRAL
-#undef BOOST_IS_UNSIGNED
-#undef BOOST_MAKE_UNSIGNED
-
-#endif // #ifndef BOOST_FUNCTIONAL_HASH_HASH_32_HPP
diff --git a/mm/include/boost_custom/container_hash/hash_fwd_32.hpp b/mm/include/boost_custom/container_hash/hash_fwd_32.hpp
deleted file mode 100644
index 2ad101f2b..000000000
--- a/mm/include/boost_custom/container_hash/hash_fwd_32.hpp
+++ /dev/null
@@ -1,25 +0,0 @@
-// 32 bit implementation based off of Boost hash
-
-#ifndef BOOST_FUNCTIONAL_HASH_FWD_32_HPP
-#define BOOST_FUNCTIONAL_HASH_FWD_32_HPP
-
-#include <boost/container_hash/hash_fwd.hpp>
-
-namespace boost
-{
-
-namespace container_hash
-{
-
-} // namespace container_hash
-
-template<class T> struct hash_32;
-
-template<class T> void hash_combine_32( uint32_t& seed, T const& v );
-
-template<class It> void hash_range_32( uint32_t&, It, It );
-template<class It> uint32_t hash_range_32( It, It );
-
-} // namespace boost
-
-#endif // #ifndef BOOST_FUNCTIONAL_HASH_FWD_32_HPP
diff --git a/mm/include/boost_custom/container_hash/version.hpp b/mm/include/boost_custom/container_hash/version.hpp
deleted file mode 100644
index 3863b507c..000000000
--- a/mm/include/boost_custom/container_hash/version.hpp
+++ /dev/null
@@ -1,11 +0,0 @@
-
-#ifndef BOOST_CONTAINER_HASH_VERSION_HPP
-#define BOOST_CONTAINER_HASH_VERSION_HPP
-
-#include <boost/version.hpp>
-
-#define BOOST_VERSION_HAS_HASH_RANGE ((BOOST_VERSION / 100 % 1000) >= 81)
-
-#define BOOST_USE_STD_TYPES ((BOOST_VERSION / 100 % 1000) >= 84)
-
-#endif // #ifndef BOOST_CONTAINER_HASH_VERSION_HPP