greg7mdp / parallel-hashmap

A family of header-only, very fast and memory-friendly hashmap and btree containers.
https://greg7mdp.github.io/parallel-hashmap/
Apache License 2.0
2.47k stars 234 forks source link

Add access to the slot in the lazy constructor #219

Closed bpmckinnon closed 9 months ago

bpmckinnon commented 9 months ago

There is a specific use case where I want to cache a pointer to the newly created lazy object. If the capacity of the map does not change between the first and second call of my function, then I use the pointer instead of repeating the lookup.

Fixed an initialization order issue in ReadWriteLock

Fix the return value of lazy_emplace and lazy_emplace_with_hash.