summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/google-perftools/files/gperftools-2.0-32bit-barrier.patch')
-rw-r--r--dev-util/google-perftools/files/gperftools-2.0-32bit-barrier.patch17
1 files changed, 17 insertions, 0 deletions
diff --git a/dev-util/google-perftools/files/gperftools-2.0-32bit-barrier.patch b/dev-util/google-perftools/files/gperftools-2.0-32bit-barrier.patch
new file mode 100644
index 0000000..df89a92
--- /dev/null
+++ b/dev-util/google-perftools/files/gperftools-2.0-32bit-barrier.patch
@@ -0,0 +1,17 @@
+Atomic64 not available on all architectures.
+Use AtomicWord instead.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+
+diff -Nuar gperftools-2.0.orig/src/base/spinlock_internal.cc gperftools-2.0/src/base/spinlock_internal.cc
+--- gperftools-2.0.orig/src/base/spinlock_internal.cc 2012-02-02 21:36:23.000000000 +0000
++++ gperftools-2.0/src/base/spinlock_internal.cc 2013-01-20 23:44:01.629077919 +0000
+@@ -80,7 +80,7 @@
+ static int SuggestedDelayNS(int loop) {
+ // Weak pseudo-random number generator to get some spread between threads
+ // when many are spinning.
+- static base::subtle::Atomic64 rand;
++ static AtomicWord rand;
+ uint64 r = base::subtle::NoBarrier_Load(&rand);
+ r = 0x5deece66dLL * r + 0xb; // numbers from nrand48()
+ base::subtle::NoBarrier_Store(&rand, r);