summaryrefslogtreecommitdiff
path: root/absl/base
diff options
context:
space:
mode:
authorGravatar Greg Falcon <gfalcon@google.com>2022-05-18 10:01:14 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2022-05-18 10:01:57 -0700
commit3e04aade4e7a53aebbbed1a1268117f1f522bfb0 (patch)
treea474a12423cb60a61e30ec03a3a9970e64ece23e /absl/base
parent9df63a8beaae53802109346f0a20328140a7cb8e (diff)
Replace direct uses of __builtin_prefetch from SwissTable with the wrapper functions.
Add a new (internal) feature test macro to detect whether the wrappers are no-ops on a given platform. Note that one-arg __builtin_prefetch(x) is equivalent to __builtin_prefetch(x, 0, 3), per `man BUILTIN_PREFETCH(3)` and gcc docs. PiperOrigin-RevId: 449508660 Change-Id: I144e750205eec0c956d8dd62bc72e10bdb87c4f7
Diffstat (limited to 'absl/base')
-rw-r--r--absl/base/internal/prefetch.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/absl/base/internal/prefetch.h b/absl/base/internal/prefetch.h
index a71b3897..d4971a68 100644
--- a/absl/base/internal/prefetch.h
+++ b/absl/base/internal/prefetch.h
@@ -72,6 +72,8 @@ void PrefetchNta(const void* addr);
#if ABSL_HAVE_BUILTIN(__builtin_prefetch) || defined(__GNUC__)
+#define ABSL_INTERNAL_HAVE_PREFETCH 1
+
// See __builtin_prefetch:
// https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html.
//