aboutsummaryrefslogtreecommitdiff
path: root/util/crc32c.cc
diff options
context:
space:
mode:
Diffstat (limited to 'util/crc32c.cc')
-rw-r--r--util/crc32c.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/util/crc32c.cc b/util/crc32c.cc
index edd61cfd6f..b3f40eeeed 100644
--- a/util/crc32c.cc
+++ b/util/crc32c.cc
@@ -288,6 +288,10 @@ static inline uint32_t LE_LOAD32(const uint8_t *p) {
// Determine if the CPU running this program can accelerate the CRC32C
// calculation.
static bool CanAccelerateCRC32C() {
+ if (!port::HasAcceleratedCRC32C())
+ return false;
+
+ // Double-check that the accelerated implementation functions correctly.
// port::AcceleretedCRC32C returns zero when unable to accelerate.
static const char kTestCRCBuffer[] = "TestCRCBuffer";
static const char kBufSize = sizeof(kTestCRCBuffer) - 1;