mirror of https://github.com/google/snappy.git
Define missing SNAPPY_PREFETCH macros.
PiperOrigin-RevId: 523287305
This commit is contained in:
parent
92f18e66fd
commit
cfc573e08f
|
@ -153,6 +153,12 @@ int main() {
|
|||
return __builtin_ctzll(0);
|
||||
}" HAVE_BUILTIN_CTZ)
|
||||
|
||||
check_cxx_source_compiles("
|
||||
int main() {
|
||||
__builtin_prefetch(0, 0, 3);
|
||||
return 0;
|
||||
}" HAVE_BUILTIN_PREFETCH)
|
||||
|
||||
check_cxx_source_compiles("
|
||||
__attribute__((always_inline)) int zero() { return 0; }
|
||||
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
/* Define to 1 if the compiler supports __builtin_expect. */
|
||||
#cmakedefine01 HAVE_BUILTIN_EXPECT
|
||||
|
||||
/* Define to 1 if the compiler supports __builtin_prefetch. */
|
||||
#cmakedefine01 HAVE_BUILTIN_PREFETCH
|
||||
|
||||
/* Define to 1 if you have a definition for mmap() in <sys/mman.h>. */
|
||||
#cmakedefine01 HAVE_FUNC_MMAP
|
||||
|
||||
|
|
|
@ -105,6 +105,12 @@
|
|||
#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE
|
||||
#endif // HAVE_ATTRIBUTE_ALWAYS_INLINE
|
||||
|
||||
#if HAVE_BUILTIN_PREFETCH
|
||||
#define SNAPPY_PREFETCH(ptr) __builtin_prefetch(ptr, 0, 3)
|
||||
#else
|
||||
#define SNAPPY_PREFETCH(ptr) (void)(ptr)
|
||||
#endif
|
||||
|
||||
// Stubbed version of ABSL_FLAG.
|
||||
//
|
||||
// In the open source version, flags can only be changed at compile time.
|
||||
|
|
Loading…
Reference in New Issue