Commit b35bea8f authored by Bo Dong's avatar Bo Dong Committed by Facebook Github Bot

remove the namespace dependency of BENCHMARK_COUNTERS

Summary: BENCHMARK_COUNTERS tests need to set `using folly::UserCounters` or `using namespace folly`. Add absolute namespace path in the macro to get rid of this requirement.

Reviewed By: Orvid

Differential Revision: D18271700

fbshipit-source-id: 084041142b7c245e3c861943570416ac89ea6c34
parent 05490a16
...@@ -387,19 +387,20 @@ void printResultComparison( ...@@ -387,19 +387,20 @@ void printResultComparison(
#define BENCHMARK_IMPL_COUNTERS( \ #define BENCHMARK_IMPL_COUNTERS( \
funName, stringName, counters, rv, paramType, paramName) \ funName, stringName, counters, rv, paramType, paramName) \
static void funName(UserCounters& FOLLY_PP_DETAIL_APPEND_VA_ARG(paramType)); \ static void funName( \
::folly::UserCounters& FOLLY_PP_DETAIL_APPEND_VA_ARG(paramType)); \
FOLLY_MAYBE_UNUSED static bool FB_ANONYMOUS_VARIABLE(follyBenchmarkUnused) = \ FOLLY_MAYBE_UNUSED static bool FB_ANONYMOUS_VARIABLE(follyBenchmarkUnused) = \
(::folly::addBenchmark( \ (::folly::addBenchmark( \
__FILE__, \ __FILE__, \
stringName, \ stringName, \
[](UserCounters& counters FOLLY_PP_DETAIL_APPEND_VA_ARG( \ [](::folly::UserCounters& counters FOLLY_PP_DETAIL_APPEND_VA_ARG( \
paramType paramName)) -> unsigned { \ paramType paramName)) -> unsigned { \
funName(counters FOLLY_PP_DETAIL_APPEND_VA_ARG(paramName)); \ funName(counters FOLLY_PP_DETAIL_APPEND_VA_ARG(paramName)); \
return rv; \ return rv; \
}), \ }), \
true); \ true); \
static void funName(UserCounters& counters FOLLY_PP_DETAIL_APPEND_VA_ARG( \ static void funName(::folly::UserCounters& counters \
paramType paramName)) FOLLY_PP_DETAIL_APPEND_VA_ARG(paramType paramName))
/** /**
* Introduces a benchmark function with support for returning the actual * Introduces a benchmark function with support for returning the actual
......
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