Commit 7a83deaa authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Use cacheline_aligned in small-locks benchmark

Summary: [Folly] Use `cacheline_aligned` in small-locks benchmark.

Reviewed By: aary

Differential Revision: D19614282

fbshipit-source-id: d5ec3e9d970654cc532a880de951ac20c898c90a
parent 4273a65c
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
#include <google/base/spinlock.h> #include <google/base/spinlock.h>
#include <folly/Benchmark.h> #include <folly/Benchmark.h>
#include <folly/CachelinePadded.h>
#include <folly/SharedMutex.h> #include <folly/SharedMutex.h>
#include <folly/experimental/flat_combining/FlatCombining.h> #include <folly/experimental/flat_combining/FlatCombining.h>
#include <folly/lang/Aligned.h>
#include <folly/synchronization/DistributedMutex.h> #include <folly/synchronization/DistributedMutex.h>
#include <folly/synchronization/SmallLocks.h> #include <folly/synchronization/SmallLocks.h>
#include <folly/synchronization/Utility.h> #include <folly/synchronization/Utility.h>
...@@ -185,7 +185,7 @@ void initialize(std::uint64_t& value) { ...@@ -185,7 +185,7 @@ void initialize(std::uint64_t& value) {
class alignas(folly::hardware_destructive_interference_size) Ints { class alignas(folly::hardware_destructive_interference_size) Ints {
public: public:
std::array<folly::CachelinePadded<std::uint64_t>, 5> ints_; std::array<folly::cacheline_aligned<std::uint64_t>, 5> ints_;
}; };
std::uint64_t write(Ints& vec) { std::uint64_t write(Ints& vec) {
auto sum = std::uint64_t{0}; auto sum = std::uint64_t{0};
...@@ -198,7 +198,7 @@ void initialize(Ints&) {} ...@@ -198,7 +198,7 @@ void initialize(Ints&) {}
class alignas(folly::hardware_destructive_interference_size) AtomicsAdd { class alignas(folly::hardware_destructive_interference_size) AtomicsAdd {
public: public:
std::array<folly::CachelinePadded<std::atomic<std::uint64_t>>, 5> ints_; std::array<folly::cacheline_aligned<std::atomic<std::uint64_t>>, 5> ints_;
}; };
std::uint64_t write(AtomicsAdd& atomics) { std::uint64_t write(AtomicsAdd& atomics) {
auto sum = 0; auto sum = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment