Summary: Some internal malloc shims broke on using folly::ThreadLocal, so only do that for `__APPLE__`.
Reviewed By: @brianwatling
Differential Revision:
D2151318
#include <folly/Optional.h>
#include <folly/Portability.h>
#include <folly/ScopeGuard.h>
+#ifdef __APPLE__
#include <folly/ThreadLocal.h>
+#endif
#include <folly/experimental/fibers/Baton.h>
#include <folly/experimental/fibers/Fiber.h>
#include <folly/experimental/fibers/LoopController.h>
template <typename T>
T& FiberManager::localThread() {
+#ifndef __APPLE__
+ static thread_local T t;
+ return t;
+#else // osx doesn't support thread_local
static ThreadLocal<T> t;
return *t;
+#endif
}
inline void FiberManager::initLocalData(Fiber& fiber) {