From d0bdf42824c0ecbd929da01d8579a4193f02c4b3 Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Fri, 21 Jun 2024 08:27:33 -0700 Subject: [PATCH] check functions for ThreadLocalPtr::get, ThreadLocal::get Differential Revision: D58831186 fbshipit-source-id: 71f8e3670ddc9f01a59d659bdd4c68e72d647ef6 --- folly/test/BUCK | 1 + folly/test/ThreadLocalBenchmark.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/folly/test/BUCK b/folly/test/BUCK index 6744da91e15..5945e1c4335 100644 --- a/folly/test/BUCK +++ b/folly/test/BUCK @@ -1721,6 +1721,7 @@ cpp_binary( "//folly:benchmark", "//folly:thread_local", "//folly/experimental/io:fs_util", + "//folly/lang:keep", "//folly/portability:gflags", ], external_deps = [ diff --git a/folly/test/ThreadLocalBenchmark.cpp b/folly/test/ThreadLocalBenchmark.cpp index 68d04cdc360..b9c773860a6 100644 --- a/folly/test/ThreadLocalBenchmark.cpp +++ b/folly/test/ThreadLocalBenchmark.cpp @@ -31,10 +31,20 @@ #include #include +#include #include using namespace folly; +extern "C" FOLLY_KEEP int* check_folly_thread_local_ptr_get( + ThreadLocalPtr* tlp) { + return tlp->get(); +} + +extern "C" FOLLY_KEEP int* check_folly_thread_local_get(ThreadLocal* tl) { + return tl->get(); +} + // Simple reference implementation using pthread_get_specific template class PThreadGetSpecific {