aboutsummaryrefslogtreecommitdiff
path: root/src/leveldb/port/port_win.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/leveldb/port/port_win.cc')
-rw-r--r--src/leveldb/port/port_win.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/leveldb/port/port_win.cc b/src/leveldb/port/port_win.cc
index 1b0f060a19..1be9e8d5b0 100644
--- a/src/leveldb/port/port_win.cc
+++ b/src/leveldb/port/port_win.cc
@@ -32,6 +32,7 @@
#include <windows.h>
#include <cassert>
+#include <intrin.h>
namespace leveldb {
namespace port {
@@ -143,5 +144,15 @@ void AtomicPointer::NoBarrier_Store(void* v) {
rep_ = v;
}
+bool HasAcceleratedCRC32C() {
+#if defined(__x86_64__) || defined(__i386__)
+ int cpu_info[4];
+ __cpuid(cpu_info, 1);
+ return (cpu_info[2] & (1 << 20)) != 0;
+#else
+ return false;
+#endif
+}
+
}
}