RCU
[folly.git] / folly / fibers / FiberManager.cpp
index 8a04bde1132245840bfb95f27d0e2974b538aff3..3c01ce17245fa0e033a2f41606d257ab81d68d83 100644 (file)
@@ -25,6 +25,7 @@
 #include <folly/fibers/Fiber.h>
 #include <folly/fibers/LoopController.h>
 
+#include <folly/ConstexprMath.h>
 #include <folly/SingletonThreadLocal.h>
 #include <folly/portability/SysSyscall.h>
 #include <folly/portability/Unistd.h>
@@ -254,8 +255,9 @@ static AsanStartSwitchStackFuncPtr getStartSwitchStackFunc() {
   }
 
   // Check whether we can find a dynamically linked enter function
-  if (nullptr != (fn = (AsanStartSwitchStackFuncPtr)dlsym(
-                      RTLD_DEFAULT, "__sanitizer_start_switch_fiber"))) {
+  if (nullptr !=
+      (fn = (AsanStartSwitchStackFuncPtr)dlsym(
+           RTLD_DEFAULT, "__sanitizer_start_switch_fiber"))) {
     return fn;
   }
 
@@ -272,8 +274,9 @@ static AsanFinishSwitchStackFuncPtr getFinishSwitchStackFunc() {
   }
 
   // Check whether we can find a dynamically linked exit function
-  if (nullptr != (fn = (AsanFinishSwitchStackFuncPtr)dlsym(
-                      RTLD_DEFAULT, "__sanitizer_finish_switch_fiber"))) {
+  if (nullptr !=
+      (fn = (AsanFinishSwitchStackFuncPtr)dlsym(
+           RTLD_DEFAULT, "__sanitizer_finish_switch_fiber"))) {
     return fn;
   }
 
@@ -290,8 +293,9 @@ static AsanUnpoisonMemoryRegionFuncPtr getUnpoisonMemoryRegionFunc() {
   }
 
   // Check whether we can find a dynamically linked unpoison function
-  if (nullptr != (fn = (AsanUnpoisonMemoryRegionFuncPtr)dlsym(
-                      RTLD_DEFAULT, "__asan_unpoison_memory_region"))) {
+  if (nullptr !=
+      (fn = (AsanUnpoisonMemoryRegionFuncPtr)dlsym(
+           RTLD_DEFAULT, "__asan_unpoison_memory_region"))) {
     return fn;
   }
 
@@ -335,7 +339,7 @@ class ScopedAlternateSignalStack {
       return;
     }
 
-    stack_ = folly::make_unique<AltStackBuffer>();
+    stack_ = std::make_unique<AltStackBuffer>();
 
     setAlternateStack(stack_->data(), stack_->size());
   }
@@ -350,7 +354,7 @@ class ScopedAlternateSignalStack {
   using AltStackBuffer = std::array<char, kAltStackSize>;
   std::unique_ptr<AltStackBuffer> stack_;
 };
-}
+} // namespace
 
 void FiberManager::registerAlternateSignalStack() {
   static folly::SingletonThreadLocal<ScopedAlternateSignalStack> singleton;
@@ -359,5 +363,5 @@ void FiberManager::registerAlternateSignalStack() {
   alternateSignalStackRegistered_ = true;
 }
 #endif
-}
-}
+} // namespace fibers
+} // namespace folly