Make folly::detail::CacheLocality portable on apple
[folly.git] / folly / detail / CacheLocality.cpp
index 87f85928d17433b0f5089f345ec30762009138ea..a6abec2ae1aabb6f454e601b34e22b1d1050dccc 100644 (file)
@@ -232,6 +232,7 @@ Getcpu::Func Getcpu::vdsoFunc() {
   return func;
 }
 
+#ifdef FOLLY_TLS
 /////////////// SequentialThreadId
 
 template<>
@@ -239,6 +240,7 @@ std::atomic<size_t> SequentialThreadId<std::atomic>::prevId(0);
 
 template<>
 FOLLY_TLS size_t SequentialThreadId<std::atomic>::currentId(0);
+#endif
 
 /////////////// AccessSpreader
 
@@ -277,7 +279,7 @@ Getcpu::Func AccessSpreader<std::atomic>::pickGetcpuFunc(size_t numStripes) {
     return &degenerateGetcpu;
   } else {
     auto best = Getcpu::vdsoFunc();
-    return best ? best : &SequentialThreadId<std::atomic>::getcpu;
+    return best ? best : &FallbackGetcpuType::getcpu;
   }
 }