/*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2015 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
*/
-#include "folly/detail/CacheLocality.h"
+#include <folly/detail/CacheLocality.h>
#include <sched.h>
#include <memory>
#include <unordered_map>
#include <glog/logging.h>
#include <gtest/gtest.h>
-#include "folly/Benchmark.h"
+#include <folly/Benchmark.h>
using namespace folly::detail;
EXPECT_EQ(cpu, again);
}
-static __thread unsigned testingCpu = 0;
+static FOLLY_TLS unsigned testingCpu = 0;
static int testingGetcpu(unsigned* cpu, unsigned* node, void* unused) {
if (cpu != nullptr) {
while (!go.load()) {
sched_yield();
}
- std::atomic<int> localWork;
+ std::atomic<int> localWork(0);
if (spreaderType == SpreaderType::SHARED) {
for (size_t i = iters; i > 0; --i) {
++*(counters[AccessSpreader<>::current(stripes)]);
while (!go.load()) {
sched_yield();
}
- std::atomic<size_t> localCounter;
- std::atomic<int> localWork;
+ std::atomic<size_t> localCounter(0);
+ std::atomic<int> localWork(0);
for (size_t i = iters; i > 0; --i) {
localCounter++;
for (size_t j = work; j > 0; --j) {
int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);
- google::ParseCommandLineFlags(&argc, &argv, true);
+ gflags::ParseCommandLineFlags(&argc, &argv, true);
auto ret = RUN_ALL_TESTS();
if (!ret && FLAGS_benchmark) {
folly::runBenchmarks();