aboutsummaryrefslogtreecommitdiff
path: root/src/leveldb/util/crc32c.cc
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-08-01 12:40:42 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-08-01 12:40:42 -0700
commit47f3e8c74d390139967cc40e37cf5b433f0b0f9f (patch)
treef43c285be47ec5bc66a25a7fa1c072d2cd32dc97 /src/leveldb/util/crc32c.cc
parentf66c59650527022b4f7abd98ff0a1a4e4741bd34 (diff)
parentb13a68e129f51b664e33b1894e33ebb7b94cdcc7 (diff)
downloadbitcoin-47f3e8c74d390139967cc40e37cf5b433f0b0f9f.tar.xz
Update LevelDB with latest Bitcoin-specific patches
Diffstat (limited to 'src/leveldb/util/crc32c.cc')
-rw-r--r--src/leveldb/util/crc32c.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/leveldb/util/crc32c.cc b/src/leveldb/util/crc32c.cc
index edd61cfd6f..b3f40eeeed 100644
--- a/src/leveldb/util/crc32c.cc
+++ b/src/leveldb/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;