Skip to content

Commit

Permalink
Sync bela
Browse files Browse the repository at this point in the history
  • Loading branch information
fcharlie committed Sep 21, 2024
1 parent a9cdec9 commit 2bca184
Show file tree
Hide file tree
Showing 53 changed files with 3,298 additions and 576 deletions.
2 changes: 1 addition & 1 deletion vendor/bela.lock
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/fcharlie/bela/tree/d92666ad2af8316ad9902723813d201a6217097a
https://github.com/fcharlie/bela/tree/f1f667f1be8ff5468b62df3a2739563126c760f8
2 changes: 2 additions & 0 deletions vendor/bela/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.27)

project(bela CXX C ASM)

include(FeatureSummary)

if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE)
message(
FATAL_ERROR
Expand Down
2 changes: 1 addition & 1 deletion vendor/bela/include/bela/__charconv/to_chars_base_10.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ template <class I> constexpr wchar_t *__append1(wchar_t *__buffer, I __value) no
}

template <class I> constexpr wchar_t *__append2(wchar_t *__buffer, I __value) noexcept {
std::memcpy(__buffer, &__digits_base_10[(__value)*2], 2 * sizeof(wchar_t));
std::memcpy(__buffer, &__digits_base_10[(__value) * 2], 2 * sizeof(wchar_t));
return __buffer + 2;
}

Expand Down
2 changes: 1 addition & 1 deletion vendor/bela/include/bela/__phmap/VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
https://github.com/greg7mdp/parallel-hashmap.git
10368163ab1f4367d2f0685b5928b1c973ebd1ec
60acfa4690303eeefde355175eaaad57c65a113d
4 changes: 4 additions & 0 deletions vendor/bela/include/bela/__phmap/phmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -3444,6 +3444,10 @@ class parallel_hash_set
return sets_[idx];
}

const Inner& get_inner(size_t idx) const {
return sets_[idx];
}

// Extension API: support for heterogeneous keys.
//
// std::unordered_set<std::string> s;
Expand Down
29 changes: 16 additions & 13 deletions vendor/bela/include/bela/__phmap/phmap_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//
// Includes work from abseil-cpp (https://github.com/abseil/abseil-cpp)
// with modifications.
//
//
// Copyright 2018 The Abseil Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -35,8 +35,8 @@
// ---------------------------------------------------------------------------

#define PHMAP_VERSION_MAJOR 1
#define PHMAP_VERSION_MINOR 3
#define PHMAP_VERSION_PATCH 12
#define PHMAP_VERSION_MINOR 4
#define PHMAP_VERSION_PATCH 0

// Included for the __GLIBC__ macro (or similar macros on other systems).
#include <limits.h>
Expand Down Expand Up @@ -81,14 +81,14 @@
#error "phmap requires __apple_build_version__ of 4211165 or higher."
#endif

// Enforce C++11 as the minimum.
// Enforce C++11 as the minimum.
#if defined(__cplusplus) && !defined(_MSC_VER)
#if __cplusplus < 201103L
#error "C++ versions less than C++11 are not supported."
#endif
#endif

// We have chosen glibc 2.12 as the minimum
// We have chosen glibc 2.12 as the minimum
#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
#if !__GLIBC_PREREQ(2, 12)
#error "Minimum required version of glibc is 2.12."
Expand All @@ -103,7 +103,7 @@
#warning "phmap assumes CHAR_BIT == 8."
#endif

// phmap currently assumes that an int is 4 bytes.
// phmap currently assumes that an int is 4 bytes.
#if INT_MAX < 2147483647
#error "phmap assumes that int is at least 4 bytes. "
#endif
Expand Down Expand Up @@ -176,10 +176,10 @@
#undef PHMAP_HAVE_TLS
#undef PHMAP_HAVE_THREAD_LOCAL
#endif
#endif
#endif

// ------------------------------------------------------------
// Checks whether the __int128 compiler extension for a 128-bit
// Checks whether the __int128 compiler extension for a 128-bit
// integral type is supported.
// ------------------------------------------------------------
#ifdef PHMAP_HAVE_INTRINSIC_INT128
Expand All @@ -197,7 +197,7 @@
#endif

// ------------------------------------------------------------------
// Checks whether the compiler both supports and enables exceptions.
// Checks whether the compiler both supports and enables exceptions.
// ------------------------------------------------------------------
#ifdef PHMAP_HAVE_EXCEPTIONS
#error PHMAP_HAVE_EXCEPTIONS cannot be directly set.
Expand Down Expand Up @@ -441,7 +441,9 @@
#define PHMAP_ATTRIBUTE_NONNULL(...)
#endif

#if PHMAP_HAVE_ATTRIBUTE(noreturn) || (defined(__GNUC__) && !defined(__clang__))
#if PHMAP_HAVE_ATTRIBUTE(noreturn)
#define PHMAP_ATTRIBUTE_NORETURN [[noreturn]]
#elif defined(__GNUC__) && !defined(__clang__)
#define PHMAP_ATTRIBUTE_NORETURN __attribute__((noreturn))
#elif defined(_MSC_VER)
#define PHMAP_ATTRIBUTE_NORETURN __declspec(noreturn)
Expand Down Expand Up @@ -646,7 +648,7 @@
// ----------------------------------------------------------------------
#if PHMAP_HAVE_CC17
#define PHMAP_IF_CONSTEXPR(expr) if constexpr ((expr))
#else
#else
#define PHMAP_IF_CONSTEXPR(expr) if ((expr))
#endif

Expand Down Expand Up @@ -680,8 +682,9 @@ namespace macros_internal {
} // namespace macros_internal
} // namespace phmap

// TODO(zhangxy): Use c++17 standard [[fallthrough]] macro, when supported.
#if defined(__clang__) && defined(__has_warning)
#if PHMAP_HAVE_CPP_ATTRIBUTE(fallthrough)
#define PHMAP_FALLTHROUGH [[fallthrough]]
#elif defined(__clang__) && defined(__has_warning)
#if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
#define PHMAP_FALLTHROUGH_INTENDED [[clang::fallthrough]]
#endif
Expand Down
20 changes: 15 additions & 5 deletions vendor/bela/include/bela/__strings/str_join_internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,21 @@ template <typename Formatter> class DereferenceFormatterImpl {
//
// AlphaNumFormatterImpl is the default in the base template, followed by
// specializations for other types.
template <typename ValueType> struct DefaultFormatter { typedef AlphaNumFormatterImpl Type; };
template <> struct DefaultFormatter<const wchar_t *> { typedef AlphaNumFormatterImpl Type; };
template <> struct DefaultFormatter<wchar_t *> { typedef AlphaNumFormatterImpl Type; };
template <> struct DefaultFormatter<std::wstring> { typedef NoFormatter Type; };
template <> struct DefaultFormatter<std::wstring_view> { typedef NoFormatter Type; };
template <typename ValueType> struct DefaultFormatter {
typedef AlphaNumFormatterImpl Type;
};
template <> struct DefaultFormatter<const wchar_t *> {
typedef AlphaNumFormatterImpl Type;
};
template <> struct DefaultFormatter<wchar_t *> {
typedef AlphaNumFormatterImpl Type;
};
template <> struct DefaultFormatter<std::wstring> {
typedef NoFormatter Type;
};
template <> struct DefaultFormatter<std::wstring_view> {
typedef NoFormatter Type;
};
template <typename ValueType> struct DefaultFormatter<ValueType *> {
typedef DereferenceFormatterImpl<typename DefaultFormatter<ValueType>::Type> Type;
};
Expand Down
20 changes: 15 additions & 5 deletions vendor/bela/include/bela/__strings/str_join_narrow_internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,21 @@ template <typename Formatter> class DereferenceFormatterImpl {
//
// AlphaNumFormatterImpl is the default in the base template, followed by
// specializations for other types.
template <typename ValueType> struct DefaultFormatter { typedef AlphaNumFormatterImpl Type; };
template <> struct DefaultFormatter<const char *> { typedef AlphaNumFormatterImpl Type; };
template <> struct DefaultFormatter<char *> { typedef AlphaNumFormatterImpl Type; };
template <> struct DefaultFormatter<std::string> { typedef NoFormatter Type; };
template <> struct DefaultFormatter<std::string_view> { typedef NoFormatter Type; };
template <typename ValueType> struct DefaultFormatter {
typedef AlphaNumFormatterImpl Type;
};
template <> struct DefaultFormatter<const char *> {
typedef AlphaNumFormatterImpl Type;
};
template <> struct DefaultFormatter<char *> {
typedef AlphaNumFormatterImpl Type;
};
template <> struct DefaultFormatter<std::string> {
typedef NoFormatter Type;
};
template <> struct DefaultFormatter<std::string_view> {
typedef NoFormatter Type;
};
template <typename ValueType> struct DefaultFormatter<ValueType *> {
typedef DereferenceFormatterImpl<typename DefaultFormatter<ValueType>::Type> Type;
};
Expand Down
2 changes: 1 addition & 1 deletion vendor/bela/include/bela/__strings/str_split_internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ template <typename T> struct HasEmplace<T, std::void_t<decltype(std::declval<T>(
// details below in Splitter<> where this is used.
std::false_type IsInitializerListDispatch(...); // default: No
template <typename T> std::true_type IsInitializerListDispatch(std::initializer_list<T> *);
template <typename T> struct IsInitializerList : decltype(IsInitializerListDispatch(static_cast<T *>(nullptr))) {};
template <typename T> struct IsInitializerList : decltype(IsInitializerListDispatch(static_cast<T *>(nullptr))){};

// A SplitterIsConvertibleTo<C>::type alias exists iff the specified condition
// is true for type 'C'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ template <typename T> struct HasEmplace<T, std::void_t<decltype(std::declval<T>(
// details below in Splitter<> where this is used.
std::false_type IsInitializerListDispatch(...); // default: No
template <typename T> std::true_type IsInitializerListDispatch(std::initializer_list<T> *);
template <typename T> struct IsInitializerList : decltype(IsInitializerListDispatch(static_cast<T *>(nullptr))) {};
template <typename T> struct IsInitializerList : decltype(IsInitializerListDispatch(static_cast<T *>(nullptr))){};

// A SplitterIsConvertibleTo<C>::type alias exists iff the specified condition
// is true for type 'C'.
Expand Down
Loading

0 comments on commit 2bca184

Please sign in to comment.