-template<>
-const AccessSpreader<std::atomic>
-AccessSpreader<std::atomic>::stripeByCore(
- CacheLocality::system<>().numCachesByLevel.front());
-
-template<>
-const AccessSpreader<std::atomic>
-AccessSpreader<std::atomic>::stripeByChip(
- CacheLocality::system<>().numCachesByLevel.back());
-
-template<>
-AccessSpreaderArray<std::atomic,128>
-AccessSpreaderArray<std::atomic,128>::sharedInstance = {};
-
-/// Always claims to be on CPU zero, node zero
-static int degenerateGetcpu(unsigned* cpu, unsigned* node, void* unused) {
- if (cpu != nullptr) {
- *cpu = 0;
- }
- if (node != nullptr) {
- *node = 0;
- }
- return 0;
-}
-
-template<>
-Getcpu::Func AccessSpreader<std::atomic>::pickGetcpuFunc(size_t numStripes) {
- if (numStripes == 1) {
- // there's no need to call getcpu if there is only one stripe.
- // This should not be common, so we don't want to waste a test and
- // branch in the main code path, but we might as well use a faster
- // function pointer
- return °enerateGetcpu;
- } else {
- auto best = Getcpu::vdsoFunc();
- return best ? best : &SequentialThreadId<std::atomic>::getcpu;
- }
-}
-
-} } // namespace folly::detail