Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions include/libpmemobj++/container/concurrent_hash_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2851,8 +2851,14 @@ class concurrent_hash_map
}

size_t max_index = mask().load(std::memory_order_acquire);
size_t start_index = (start_percent * max_index) / 100;
size_t end_index = (end_percent * max_index) / 100;
size_t start_index =
static_cast<size_t>((start_percent * max_index) / 100);
size_t end_index =
static_cast<size_t>((end_percent * max_index) / 100);

/* Make sure we do not use too big index, even in case of
* rounding errors. */
end_index = (std::min)(end_index, max_index);

#if LIBPMEMOBJ_CPP_VG_HELGRIND_ENABLED
ANNOTATE_HAPPENS_AFTER(&(this->my_mask));
Expand Down