Summary: AHM::find checks that the returned SimpleRetT index is >= numMapsAllocated_ but that value may have changed and find pick the first element in the next sub map. Use success instead.
@override-unit-failures
Test Plan: unit tests
Reviewed By: delong.j@fb.com
FB internal diff:
D1126684
AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn, Allocator>::
find(KeyT k) {
SimpleRetT ret = findInternal(k);
- if (ret.i >= numMapsAllocated_.load(std::memory_order_acquire)) {
+ if (!ret.success) {
return end();
}
SubMap* subMap = subMaps_[ret.i].load(std::memory_order_relaxed);