Commit Graph

303 Commits

Author SHA1 Message Date
Ed Catmur 4468822524 Add try_emplace_p extension method
Iterators are invalidated by concurrent insertion (rehash, resize, etc...) whereas for node-based containers, pointers are only invalidated by erase/clear.
2023-09-12 00:31:30 +01:00
greg7mdp 3362017f22 Fix issue with my previous change for issue #205 2023-09-03 23:48:09 -04:00
greg7mdp 38ded9bba8 Simplify clear() and avoid iterating when values have trivial destructor.
Resolves #205.
2023-09-02 14:47:18 -04:00
Ed Catmur 2ac0518a81 Fix C++17 detection for clang
Clang (even recent, e.g. llvm 16) sets __GNUC__ to 4, so the check for C++17 fails.

This results in the check for invoke_result_t in phmap_base.h failing, so it uses std::result_of, which is removed entirely in recent libc++, breaking the build.
2023-06-28 14:30:07 -05:00
greg7mdp f67dadd00a Fix compilation errors with gcc 4.8.5
Thanks to @aengusjiang for the initial PR, which I updated to simplify and fix compilation issues on windows.
2023-06-25 14:48:33 -04:00
greg7mdp 292c29dd9d Cleanup some compilation warnings with old gcc compiler. 2023-06-25 14:48:00 -04:00
ilobilo b54ef015de remove unnecessary creation of std *_error objects
remove creation and then casting to (void) of std::*_error objects if exceptions are disabled
2023-06-11 21:11:32 +04:00
greg7mdp 714d70b6ca Fix clang "thread-safety-analysis" warnings - issue #196 2023-06-11 10:02:00 -04:00
Gregory Popovitch 07e93a8d91 minor change and add comment 2023-05-30 08:22:17 -04:00
tingyu 875d5e48e5 fix: add version to make dump & load compatible with previous files 2023-05-30 14:21:39 +08:00
lisa0916lisa@163.com 8c8550dcb5 fix: add growth_left for dump and load, to fix the bug that when loading from a phmap which has a lot of deleted slots may cause further inserts to hang 2023-05-30 00:09:40 +08:00
greg7mdp 1df34e5616 remove commented lines 2023-05-21 17:14:47 -04:00
greg7mdp a68a9b50b0 Fix unused variable warning (issue #194) 2023-05-17 10:32:47 -04:00
Sergey Fedorov 4b113aac1b Update parallel_hashmap/phmap_config.h
Co-authored-by: Gregory Popovitch <greg7mdp@gmail.com>
2023-05-16 21:11:08 +08:00
Sergey Fedorov 47ee627eab Unbreak build on Apple with GCC: do not use clangism
Fixes: https://github.com/greg7mdp/parallel-hashmap/issues/192
2023-05-16 20:06:11 +08:00
Sergey Fedorov 0e534ee7e0 Warn on 4-byte char, not err out 2023-05-16 20:03:36 +08:00
greg7mdp 45edb98cd9 Replace custom CompressedTuple with std::tuple. 2023-04-30 11:00:37 -04:00
greg7mdp 41e82fbad4 Remove conanfile.py 2023-04-27 21:21:30 -04:00
greg7mdp be6a2c7985 Bump version to 1.3.11 2023-04-23 23:44:16 -04:00
greg7mdp 4fe3c8d502 Bump version to 1.3.10 2023-04-23 23:38:35 -04:00
greg7mdp 002f58edd1 Fix another clang-tidy warning 2023-04-23 19:51:43 -04:00
greg7mdp 16287ccca6 Cleanup some clang-tidy issues 2023-04-23 19:40:33 -04:00
greg7mdp e4b6668d46 Bump conan version 2023-04-23 18:59:34 -04:00
greg7mdp f31c11f2ec Update version to 1.3.9 2023-04-23 18:10:21 -04:00
greg7mdp 78071573aa Fix issue #117 - segfault when out of memory.
when constructing an object to be inserted throws std::bad_alloc, the slot was mark as used
(even though the object was not properly constructed), so eventually the destructor of a
non-initialized object was called causing a segfault.

Solution: mark the slot used only after the object is successfully constructed.
2023-04-15 20:22:50 -04:00
greg7mdp 3a4f3983a1 Fix a couple return type mismatches reported by clang-tidy. 2023-04-15 16:02:43 -04:00
greg7mdp 59d56923f5 Add example mt_word_counter 2023-04-09 18:48:26 -04:00
greg7mdp 8540627c91 issue #187 - swap allocators only if permitted by AllocTraits 2023-04-08 21:12:42 -04:00
greg7mdp 7883cb6cd1 Remove #ifdef 1 - no change in behavior. 2023-03-26 11:18:26 -04:00
greg7mdp 55725dbe70 Improve check for <shared_mutex> existence 2023-03-12 18:31:12 -04:00
greg7mdp e7df60b86d Make Throw a macro, for platforms missing definitions for std::*_error types. 2023-03-12 18:20:43 -04:00
greg7mdp c36739b79f fix typo in comment (erase instead of _erase) 2022-11-29 09:19:25 -05:00
greg7mdp d676385fb4 Fix clang-15 warnings 2022-11-19 14:25:19 -05:00
greg7mdp ab663358bc Remove deprecated use of std::aligned_storage. Issue #171 2022-11-05 16:11:40 -04:00
greg7mdp dc5bd3620e Disable assert causing duplicated hash calls when NDEBUG is not defined - issue #168 2022-10-03 09:09:34 -04:00
greg7mdp 4ca9c6a119 update version number 2022-10-01 15:53:35 -04:00
greg7mdp cc5b24b42c Fix file mode issue 2022-10-01 00:02:25 -04:00
greg7mdp a10ad015db Update phmap::Hash so that std::hash<Foo*> can be overridden - issue #168 2022-10-01 00:01:18 -04:00
greg7mdp 736b921c1a Update version numbers 2022-09-30 19:53:46 -04:00
greg7mdp f0409c6d05 Fix access of protected member, and add test for templated swap() 2022-09-11 12:16:35 -04:00
greg7mdp 0d912f754f Allow swapping parallel hash maps/sets with different mutex types 2022-09-11 10:07:32 -04:00
greg7mdp ca9f02fda3 Fix issue #44 - example to dump TriviallyCopyable types doesn't work any
more
2022-08-12 20:24:24 -04:00
greg7mdp d62b8472a3 Add doc for parallel hashmap extended APIs, and remove some unnecessary casts in phmap.hpp 2022-07-25 22:57:43 -04:00
greg7mdp d24c47fdce Add with_submap api for parallel maps allowing access to submaps under lock protection 2022-07-25 21:37:43 -04:00
greg7mdp f71777d540 Small cleanup in StringHashEqT definition 2022-07-22 19:03:02 -04:00
greg7mdp 8650bcc503 Fix compiler warning in btree - issue #156 2022-07-22 10:22:44 -04:00
Patrick Fasano 6fc51c1b49 execution: Overloads of for_each and for_each_m taking ExecutionPolicy
* Adds additional overloads to `for_each` and `for_each_m` that accept execution policies.
* Execution policy is applied to the loop over subsets.
2022-07-21 12:19:58 -04:00
greg7mdp 1249057455 Fix issue #158 - imperfect hash for tuple of small integers 2022-07-19 20:32:09 -04:00
greg7mdp 01ea8093e6 use ADL lookup for erase_if instead of adding to std (gtl reported issue) 2022-06-25 14:55:26 -04:00
greg7mdp ce7710e9c3 Fix HashtableDebugAccess as in gtl 2022-06-21 21:03:16 -04:00