Commit bdbdd4b3 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

use LOG_FIRST_N in MemoryIdler

Summary: Use `LOG_FIRST_N` in `MemoryIdler` rather than reimplement it.

Reviewed By: praihan

Differential Revision: D26185702

fbshipit-source-id: c1045ef8bf6aabefa4c0806c35c156539d6e594f
parent 536086dc
......@@ -16,7 +16,6 @@
#include <folly/detail/MemoryIdler.h>
#include <atomic>
#include <climits>
#include <cstdio>
#include <cstring>
......@@ -97,11 +96,7 @@ static void fetchStackLimits() {
pthread_attr_t attr;
if ((err = pthread_getattr_np(pthread_self(), &attr))) {
// some restricted environments can't access /proc
static std::atomic<bool> flag{false};
if (!flag.exchange(true, std::memory_order_relaxed)) {
LOG(WARNING) << "pthread_getaddr_np failed errno=" << err;
}
LOG_FIRST_N(WARNING, 1) << "pthread_getaddr_np failed errno=" << err;
tls_stackSize = 1;
return;
}
......
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