From f2423568ba9c5da9553a7acfdf66d1d700e207b0 Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Thu, 26 May 2016 12:25:43 -0700 Subject: [PATCH] Disable the signal stack on Windows Summary: There is no equivalent functionality for Windows, so disable it completely. Reviewed By: andriigrynenko Differential Revision: D3348481 fbshipit-source-id: 52a104f5a8013113f54d5b10c2f0f9b720eeb4f6 --- folly/fibers/FiberManager-inl.h | 2 ++ folly/fibers/FiberManager.cpp | 2 ++ folly/fibers/FiberManager.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/folly/fibers/FiberManager-inl.h b/folly/fibers/FiberManager-inl.h index 003da1bd..3fe5b5f5 100644 --- a/folly/fibers/FiberManager-inl.h +++ b/folly/fibers/FiberManager-inl.h @@ -164,9 +164,11 @@ inline void FiberManager::runReadyFiber(Fiber* fiber) { } inline bool FiberManager::loopUntilNoReady() { +#ifndef _WIN32 if (UNLIKELY(!alternateSignalStackRegistered_)) { registerAlternateSignalStack(); } +#endif // Support nested FiberManagers auto originalFiberManager = this; diff --git a/folly/fibers/FiberManager.cpp b/folly/fibers/FiberManager.cpp index 727b7d7f..5c8373d0 100644 --- a/folly/fibers/FiberManager.cpp +++ b/folly/fibers/FiberManager.cpp @@ -277,6 +277,7 @@ static AsanUnpoisonMemoryRegionFuncPtr getUnpoisonMemoryRegionFunc() { #endif // FOLLY_SANITIZE_ADDRESS +#ifndef _WIN32 namespace { // SIGSTKSZ (8 kB on our architectures) isn't always enough for @@ -333,5 +334,6 @@ void FiberManager::registerAlternateSignalStack() { alternateSignalStackRegistered_ = true; } +#endif } } diff --git a/folly/fibers/FiberManager.h b/folly/fibers/FiberManager.h index a2474b62..117c26cb 100644 --- a/folly/fibers/FiberManager.h +++ b/folly/fibers/FiberManager.h @@ -468,9 +468,11 @@ class FiberManager : public ::folly::Executor { #endif // FOLLY_SANITIZE_ADDRESS +#ifndef _WIN32 bool alternateSignalStackRegistered_{false}; void registerAlternateSignalStack(); +#endif }; /** -- 2.34.1