Commit 2cb34df8 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Change an ifdef to a constexpr ternary

Summary: [Folly] Change an `#ifdef` to a constexpr ternary for `MemoryMapping`.

Reviewed By: meyering

Differential Revision: D18024494

fbshipit-source-id: 7ee040891ecee9bccf46af1dc43e54946e676c70
parent 60df0a6b
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <glog/logging.h> #include <glog/logging.h>
#include <folly/Format.h> #include <folly/Format.h>
#include <folly/Portability.h>
#include <folly/portability/GFlags.h> #include <folly/portability/GFlags.h>
#include <folly/portability/SysMman.h> #include <folly/portability/SysMman.h>
#include <folly/portability/SysSyscall.h> #include <folly/portability/SysSyscall.h>
...@@ -36,18 +37,14 @@ ...@@ -36,18 +37,14 @@
#include <sys/types.h> #include <sys/types.h>
#include <system_error> #include <system_error>
static constexpr ssize_t kDefaultMlockChunkSize = static constexpr ssize_t kDefaultMlockChunkSize = !folly::kMscVer
#ifndef _MSC_VER
// Linux implementations of unmap/mlock/munlock take a kernel // Linux implementations of unmap/mlock/munlock take a kernel
// semaphore and block other threads from doing other memory // semaphore and block other threads from doing other memory
// operations. Split the operations in chunks. // operations. Split the operations in chunks.
(1 << 20) // 1MB ? (1 << 20) // 1MB
#else // _MSC_VER
// MSVC doesn't have this problem, and calling munmap many times // MSVC doesn't have this problem, and calling munmap many times
// with the same address is a bad idea with the windows implementation. // with the same address is a bad idea with the windows implementation.
(-1) : (-1);
#endif // _MSC_VER
;
DEFINE_int64( DEFINE_int64(
mlock_chunk_size, mlock_chunk_size,
......
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