#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>
}
// 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;
}
}
// 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;
}
}
// 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;
}
return;
}
- stack_ = folly::make_unique<AltStackBuffer>();
+ stack_ = std::make_unique<AltStackBuffer>();
setAlternateStack(stack_->data(), stack_->size());
}
using AltStackBuffer = std::array<char, kAltStackSize>;
std::unique_ptr<AltStackBuffer> stack_;
};
-}
+} // namespace
void FiberManager::registerAlternateSignalStack() {
static folly::SingletonThreadLocal<ScopedAlternateSignalStack> singleton;
alternateSignalStackRegistered_ = true;
}
#endif
-}
-}
+} // namespace fibers
+} // namespace folly