Commit b83cd9e3 authored by Mohamed Amin JABRI's avatar Mohamed Amin JABRI Committed by Facebook Github Bot

Fix unittest compile error on futures/test/RetryingTest.cpp.

Summary:
On MacOS compiling unittests with "make chek" shows the following compile
error:
```
../futures/test/RetryingTest.cpp:168:26: error: no matching function for call to 'min'
 newMemLimit.rlim_cur = std::min(1UL << 30, oldMemLimit.rlim_max);
```
Closes https://github.com/facebook/folly/pull/680

Reviewed By: elsteveogrande

Differential Revision: D5921433

Pulled By: yfeldblum

fbshipit-source-id: 236d8336f852750a983c2e268db8811d1a4ed9ee
parent b6845258
...@@ -165,7 +165,8 @@ TEST(RetryingTest, large_retries) { ...@@ -165,7 +165,8 @@ TEST(RetryingTest, large_retries) {
PCHECK(getrlimit(RLIMIT_AS, &oldMemLimit) == 0); PCHECK(getrlimit(RLIMIT_AS, &oldMemLimit) == 0);
rlimit newMemLimit; rlimit newMemLimit;
newMemLimit.rlim_cur = std::min(1UL << 30, oldMemLimit.rlim_max); newMemLimit.rlim_cur =
std::min(static_cast<rlim_t>(1UL << 30), oldMemLimit.rlim_max);
newMemLimit.rlim_max = oldMemLimit.rlim_max; newMemLimit.rlim_max = oldMemLimit.rlim_max;
if (!folly::kIsSanitizeAddress) { // ASAN reserves outside of the rlimit if (!folly::kIsSanitizeAddress) { // ASAN reserves outside of the rlimit
PCHECK(setrlimit(RLIMIT_AS, &newMemLimit) == 0); PCHECK(setrlimit(RLIMIT_AS, &newMemLimit) == 0);
......
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