diff --git a/xo-arena/include/xo/arena/DArenaHashMap.hpp b/xo-arena/include/xo/arena/DArenaHashMap.hpp index da0e742a..c40f6926 100644 --- a/xo-arena/include/xo/arena/DArenaHashMap.hpp +++ b/xo-arena/include/xo/arena/DArenaHashMap.hpp @@ -55,9 +55,11 @@ namespace xo { public: /** create hash map **/ - DArenaHashMap(size_type hint_max_capacity, + DArenaHashMap(const std::string & name, + size_type hint_max_capacity, bool debug_flag = false); - DArenaHashMap(Hash && hash = Hash(), + DArenaHashMap(const std::string & name, + Hash && hash = Hash(), Equal && eq = Equal(), size_type hint_max_capacity = 0, bool debug_flag = false); @@ -196,9 +198,10 @@ namespace xo { }; template - DArenaHashMap::DArenaHashMap(size_type hint_max_capacity, + DArenaHashMap::DArenaHashMap(const std::string & name, + size_type hint_max_capacity, bool debug_flag) - : DArenaHashMap(Hash(), Equal(), hint_max_capacity, debug_flag) + : DArenaHashMap(name, Hash(), Equal(), hint_max_capacity, debug_flag) { } @@ -207,13 +210,14 @@ namespace xo { * last 16 bytes will be copy of first 16 bytes */ template - DArenaHashMap::DArenaHashMap(Hash && hash, + DArenaHashMap::DArenaHashMap(const std::string & name, + Hash && hash, Equal && eq, size_type hint_max_capacity, bool debug_flag) : hash_{std::move(hash)}, equal_{std::move(eq)}, - store_{"arenahashmap", lub_exp2(lub_group_mult(hint_max_capacity))}, + store_{name, lub_exp2(lub_group_mult(hint_max_capacity))}, debug_flag_{debug_flag} { } diff --git a/xo-arena/include/xo/arena/MemorySizeInfo.hpp b/xo-arena/include/xo/arena/MemorySizeInfo.hpp index f12dcce5..540453fd 100644 --- a/xo-arena/include/xo/arena/MemorySizeInfo.hpp +++ b/xo-arena/include/xo/arena/MemorySizeInfo.hpp @@ -5,6 +5,7 @@ #pragma once +#include #include #include diff --git a/xo-arena/include/xo/arena/hashmap/HashMapStore.hpp b/xo-arena/include/xo/arena/hashmap/HashMapStore.hpp index 22bfb120..34850222 100644 --- a/xo-arena/include/xo/arena/hashmap/HashMapStore.hpp +++ b/xo-arena/include/xo/arena/hashmap/HashMapStore.hpp @@ -32,11 +32,11 @@ namespace xo { n_slot_{group_exp2.second * c_group_size}, control_{control_vector_type::map (xo::mm::ArenaConfig{ - .name_ = name, + .name_ = name + "-ctl", .size_ = control_size(n_slot_)})}, slots_{slot_vector_type::map (xo::mm::ArenaConfig{ - .name_ = name, + .name_ = name + "-slots", .size_ = n_slot_ * sizeof(value_type)})} { /* here: arenas have allocated address range, but no committed memory yet */ diff --git a/xo-arena/src/arena/DCircularBuffer.cpp b/xo-arena/src/arena/DCircularBuffer.cpp index 667126af..372462f4 100644 --- a/xo-arena/src/arena/DCircularBuffer.cpp +++ b/xo-arena/src/arena/DCircularBuffer.cpp @@ -75,7 +75,7 @@ namespace xo { mapped_range_{reserved_range_.prefix(0)}, occupied_range_{mapped_range_.prefix(0)}, input_range_{occupied_range_.prefix(0)}, - pinned_spans_{} + pinned_spans_{DArenaVector::map(ArenaConfig().with_name(config.name_ + "-pins"))} { } diff --git a/xo-arena/utest/DArenaHashMap.test.cpp b/xo-arena/utest/DArenaHashMap.test.cpp index bc672c8b..02ac3fc3 100644 --- a/xo-arena/utest/DArenaHashMap.test.cpp +++ b/xo-arena/utest/DArenaHashMap.test.cpp @@ -24,7 +24,7 @@ namespace xo { { using HashMap = DArenaHashMap; - HashMap map; + HashMap map("utest"); REQUIRE(map.empty()); REQUIRE(map.size() == 0); @@ -36,7 +36,7 @@ namespace xo { { using HashMap = DArenaHashMap; - HashMap map(257); + HashMap map("utest", 257); REQUIRE(map.empty()); REQUIRE(map.size() == 0); @@ -49,7 +49,7 @@ namespace xo { { using HashMap = DArenaHashMap; - HashMap map; + HashMap map("utest"); REQUIRE(map.empty()); REQUIRE(map.size() == 0); @@ -209,7 +209,7 @@ namespace xo { */ for (std::uint32_t n = 0; n <= 8; ) { - HashMap hash_map; + HashMap hash_map("utest"); auto test_fn = [&rgen, &hash_map](bool dbg_flag, std::uint32_t n) @@ -245,7 +245,7 @@ namespace xo { using HashMap = DArenaHashMap; - HashMap map; + HashMap map("utest"); // copy keys here so we can print stuff std::vector key_v; @@ -336,7 +336,7 @@ namespace xo { { using HashMap = DArenaHashMap; - HashMap map(1024); + HashMap map("utest", 1024); REQUIRE(map.verify_ok()); diff --git a/xo-expression2/src/expression2/StringTable.cpp b/xo-expression2/src/expression2/StringTable.cpp index 174c9e9f..2d23d03e 100644 --- a/xo-expression2/src/expression2/StringTable.cpp +++ b/xo-expression2/src/expression2/StringTable.cpp @@ -19,7 +19,7 @@ namespace xo { bool debug_flag) : strings_{DArena::map(ArenaConfig{.name_ = "strings", .size_ = hint_max_capacity})}, - map_{hint_max_capacity} + map_{"stringkeys", hint_max_capacity} { (void)debug_flag; } diff --git a/xo-reader2/include/xo/reader2/ReaderConfig.hpp b/xo-reader2/include/xo/reader2/ReaderConfig.hpp index 5b02e62c..62e0e758 100644 --- a/xo-reader2/include/xo/reader2/ReaderConfig.hpp +++ b/xo-reader2/include/xo/reader2/ReaderConfig.hpp @@ -28,7 +28,7 @@ namespace xo { bool tk_debug_flag_ = false; /** arena configuration for parser stack **/ - ArenaConfig parser_arena_config_ { .name_ = "parer-arena", + ArenaConfig parser_arena_config_ { .name_ = "parser-arena", .size_ = 2*1024*1024, .hugepage_z_ = 2*1024*1024, .store_header_flag_ = false,