mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 20:55:44 +00:00
replace parallel_hashmap with gtl (#4225)
This commit is contained in:
+8
-8
@@ -141,19 +141,19 @@ http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "ht
|
||||
bazel_dep(name = "flatbuffers", version = "25.2.10")
|
||||
|
||||
#
|
||||
# parallel-hashmap
|
||||
# gtl (for parallel_hashmap)
|
||||
#
|
||||
|
||||
parallel_hashmap_version = "1.4.1"
|
||||
gtl_version = "1.2.0"
|
||||
|
||||
parallel_hashmap_sha = "aac333eac3627698ca922102fd2a5921df8976906dff6b8e247a49e8cf363911"
|
||||
gtl_sha = "1969c45dd76eac0dd87e9e2b65cffe358617f4fe1bcd203f72f427742537913a"
|
||||
|
||||
http_archive(
|
||||
name = "parallel_hashmap",
|
||||
build_file = "@//external:BUILD.parallel_hashmap",
|
||||
sha256 = parallel_hashmap_sha,
|
||||
strip_prefix = "parallel-hashmap-%s" % parallel_hashmap_version,
|
||||
url = "https://github.com/greg7mdp/parallel-hashmap/archive/refs/tags/v%s.zip" % parallel_hashmap_version,
|
||||
name = "gtl",
|
||||
build_file = "@//external:BUILD.gtl",
|
||||
sha256 = gtl_sha,
|
||||
strip_prefix = "gtl-%s" % gtl_version,
|
||||
url = "https://github.com/greg7mdp/gtl/archive/refs/tags/v%s.zip" % gtl_version,
|
||||
)
|
||||
|
||||
#
|
||||
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
cc_library(
|
||||
name = "gtl",
|
||||
hdrs = glob(["include/gtl/*.hpp"]),
|
||||
includes = ["include"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
cc_library(
|
||||
name = "parallel_hashmap",
|
||||
hdrs = glob(["parallel_hashmap/*.h"]),
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
+6
-6
@@ -12,7 +12,7 @@
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wthread-safety-analysis"
|
||||
#pragma GCC diagnostic ignored "-Wunused-result"
|
||||
#include "parallel_hashmap/phmap.h"
|
||||
#include <gtl/phmap.hpp>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
namespace shardok {
|
||||
@@ -24,7 +24,7 @@ struct MapId {
|
||||
int64_t modifierId;
|
||||
|
||||
friend size_t hash_value(const MapId& id) {
|
||||
return phmap::HashState::combine(0, id.terrainTypesId, id.modifierId);
|
||||
return gtl::HashState::combine(0, id.terrainTypesId, id.modifierId);
|
||||
}
|
||||
|
||||
auto operator==(const MapId& other) const -> bool {
|
||||
@@ -51,7 +51,7 @@ struct FullCacheKey {
|
||||
// Hash function for FullCacheKey
|
||||
struct FullCacheKeyHash {
|
||||
size_t operator()(const FullCacheKey& key) const {
|
||||
return phmap::HashState::combine(
|
||||
return gtl::HashState::combine(
|
||||
hash_value(key.mapId),
|
||||
key.battalionTypeId,
|
||||
key.includeBravingWater,
|
||||
@@ -61,11 +61,11 @@ struct FullCacheKeyHash {
|
||||
|
||||
class ActionPointDistancesCache {
|
||||
private:
|
||||
using APDMap = phmap::parallel_flat_hash_map<
|
||||
using APDMap = gtl::parallel_flat_hash_map<
|
||||
APDKey,
|
||||
shared_ptr<ActionPointDistances>,
|
||||
phmap::priv::hash_default_hash<APDKey>,
|
||||
phmap::priv::hash_default_eq<APDKey>,
|
||||
gtl::priv::hash_default_hash<APDKey>,
|
||||
gtl::priv::hash_default_eq<APDKey>,
|
||||
std::allocator<std::pair<const APDKey, shared_ptr<ActionPointDistances>>>,
|
||||
6,
|
||||
std::mutex>;
|
||||
|
||||
@@ -30,7 +30,7 @@ cc_library(
|
||||
":fixed_action_point_distances",
|
||||
"//src/main/cpp/net/eagle0/shardok/library/map:hex_map_hasher",
|
||||
"//src/main/protobuf/net/eagle0/shardok/storage:action_result_cc_proto",
|
||||
"@parallel_hashmap",
|
||||
"@gtl",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user