Closed kishorenc closed 3 months ago
Here's a minimally reproducible example that causes a crash:
#include <iostream> #include <tsl/htrie_map.h> int main() { tsl::htrie_map<char, std::string> data_map; std::cout << "Inserting items into map..." << std::endl; data_map.emplace("data", "foo"); for(size_t i = 0; i < 30000; i++) { std::string key = "data." + std::to_string(i); data_map.insert(key, "foo"); } size_t count = 0; std::cout << "Erase prefix..." << std::endl; data_map.erase_prefix("data."); std::cout << "Start iteration..." << std::endl; for(auto it = data_map.begin(); it != data_map.end(); it++) { count++; } std::cout << "End iteration, count: " << count << std::endl; return 0; }
Hi,
Thank you for the report and sorry for the delay.
The https://github.com/Tessil/hat-trie/commit/ad6d85cfa239b26e2ce5dbfe13a51a1c581799a4 commit should fix the issue, if you could try it out.
Here's a minimally reproducible example that causes a crash: