Commit 2b5dedea authored by Xavier Deguillard's avatar Xavier Deguillard Committed by Facebook GitHub Bot

HazptrDomain: fix MSVC truncation warning

Summary:
The MSVC compiler complains about truncation of size_t to int:

  Z:\installed\folly\include\folly/synchronization/HazptrDomain.h(210): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data

MSVC being very verbose, this is followed by 25 lines of template expansion.

Since `shard` is a size_t due to `calc_shard` returning that type, let's simply
make the shard argument of hazptr_warning_list_too_large a size_t too to
silence the warning.

Reviewed By: magedm

Differential Revision: D24365556

fbshipit-source-id: b426cee7caaf593eb112691bc45b83e564342b0e
parent 3f6324de
...@@ -747,7 +747,7 @@ class hazptr_domain { ...@@ -747,7 +747,7 @@ class hazptr_domain {
} }
FOLLY_EXPORT FOLLY_NOINLINE void FOLLY_EXPORT FOLLY_NOINLINE void
hazptr_warning_list_too_large(uintptr_t tag, int shard, int count) { hazptr_warning_list_too_large(uintptr_t tag, size_t shard, int count) {
static std::atomic<uint64_t> warning_count{0}; static std::atomic<uint64_t> warning_count{0};
if ((warning_count++ % 10000) == 0) { if ((warning_count++ % 10000) == 0) {
LOG(WARNING) << "Hazptr retired list too large:" LOG(WARNING) << "Hazptr retired list too large:"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment