Fix to build SharedMutexTest on aarch64
[folly.git] / folly / test / function_benchmark / benchmark_impl.h
index 3d9926548eeb72db62446aef0f2d58d62846eaf0..fdf52a5f0cb5a8b3f8f89219f840ed2b6f7baa65 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef BENCHMARK_IMPL_H_
-#define BENCHMARK_IMPL_H_
+
+#pragma once
 
 #include <functional>
 
+#include <folly/Function.h>
+
 class TestClass;
 class VirtualClass;
 
 void BM_fn_ptr_invoke_impl(int iters, void (*fn)());
 void BM_std_function_invoke_impl(int iters, const std::function<void()>& fn);
+void BM_Function_invoke_impl(int iters,
+                             const folly::Function<void() const>& fn);
 void BM_mem_fn_invoke_impl(int iters,
                            TestClass* tc,
                            void (TestClass::*memfn)());
@@ -39,11 +43,9 @@ inline void BM_fn_ptr_invoke_inlined_impl(int iters, void (*fn)()) {
 
 // Invoke a function object as a template parameter.
 // This can be used to directly invoke lambda functions
-template<typename T>
+template <typename T>
 void BM_invoke_fn_template_impl(int iters, const T& fn) {
   for (int n = 0; n < iters; ++n) {
     fn();
   }
 }
-
-#endif // BENCHMARK_IMPL_H_