Skip to content

Commit

Permalink
Sync phmap
Browse files Browse the repository at this point in the history
  • Loading branch information
fcharlie committed Aug 31, 2024
1 parent d92666a commit 611a3ea
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion 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
63acc3336f941c6f324c88eb9ee4ce623a460cd5
4 changes: 4 additions & 0 deletions 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
25 changes: 14 additions & 11 deletions 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 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

0 comments on commit 611a3ea

Please sign in to comment.