/*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// Use a read lock for reading.
SYNCHRONIZED_CONST(pages, protectedPages()) {
for (const auto& page : pages) {
- intptr_t pageEnd = page + pagesize();
+ intptr_t pageEnd = intptr_t(page + pagesize());
if (page <= addr && addr < pageEnd) {
return true;
}
std::vector<std::pair<unsigned char*, bool>> freeList_;
static size_t pagesize() {
- static const size_t pagesize = sysconf(_SC_PAGESIZE);
+ static const size_t pagesize = size_t(sysconf(_SC_PAGESIZE));
return pagesize;
}
sigaction(SIGSEGV, &sa, &oldSigsegvAction);
});
}
-}
+} // namespace
#endif
std::lock_guard<folly::SpinLock> lg(lock_);
if (inUse_ < kMaxInUse) {
++inUse_;
- return folly::make_unique<StackCacheEntry>(stackSize);
+ return std::make_unique<StackCacheEntry>(stackSize);
}
return nullptr;
class StackCacheEntry {
public:
explicit StackCacheEntry(size_t stackSize)
- : stackCache_(folly::make_unique<StackCache>(stackSize)) {}
+ : stackCache_(std::make_unique<StackCache>(stackSize)) {}
StackCache& cache() const noexcept {
return *stackCache_;
fallbackAllocator_.deallocate(limit, size);
}
}
-}
-} // folly::fibers
+} // namespace fibers
+} // namespace folly