From a3e7a665ad62ab276b098c3c10460f111ea81200 Mon Sep 17 00:00:00 2001 From: Matt Stancliff Date: Thu, 26 Jun 2014 08:55:47 -0400 Subject: [PATCH] Allow __powerpc__ to define HAVE_ATOMIC too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From mailing list post https://groups.google.com/forum/#!topic/redis-db/D3k7KmJmYgM In the file “config.h”, the definition HAVE_ATOMIC is used to indicate if an architecture on which redis is implemented supports atomic synchronization primitives. Powerpc supports atomic synchronization primitives, however, it is not listed as one of the architectures supported in config.h. This patch adds the __powerpc__ to the list of architectures supporting these primitives. The improvement of redis due to the atomic synchronization on powerpc is significant, around 30% to 40%, over the default implementation using pthreads. This proposal adds __powerpc__ to the list of architectures designated to support atomic builtins. --- src/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.h b/src/config.h index 8041f7eb..1bc70a13 100644 --- a/src/config.h +++ b/src/config.h @@ -185,7 +185,7 @@ void setproctitle(const char *fmt, ...); #error "Undefined or invalid BYTE_ORDER" #endif -#if (__i386 || __amd64) && __GNUC__ +#if (__i386 || __amd64 || __powerpc__) && __GNUC__ #define GNUC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) #if (GNUC_VERSION >= 40100) || defined(__clang__) #define HAVE_ATOMIC