Commit 15cf5378 authored by Maik Riechert's avatar Maik Riechert Committed by Adam Cozzette

make use of RDTSC optional as it may not be available

One example is when using seccomp with PR_SET_TSC set to PR_TSC_SIGSEGV.
parent c3721151
......@@ -937,7 +937,7 @@ class Map {
// Return a randomish value.
size_type Seed() const {
size_type s = static_cast<size_type>(reinterpret_cast<uintptr_t>(this));
#if defined(__x86_64__) && defined(__GNUC__)
#if defined(__x86_64__) && defined(__GNUC__) && !defined(GOOGLE_PROTOBUF_NO_RDTSC)
uint32 hi, lo;
asm("rdtsc" : "=a"(lo), "=d"(hi));
s += ((static_cast<uint64>(hi) << 32) | lo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment