Commit a3e7a665 authored by Matt Stancliff's avatar Matt Stancliff
Browse files

Allow __powerpc__ to define HAVE_ATOMIC too

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.
parent a953c883
...@@ -185,7 +185,7 @@ void setproctitle(const char *fmt, ...); ...@@ -185,7 +185,7 @@ void setproctitle(const char *fmt, ...);
#error "Undefined or invalid BYTE_ORDER" #error "Undefined or invalid BYTE_ORDER"
#endif #endif
#if (__i386 || __amd64) && __GNUC__ #if (__i386 || __amd64 || __powerpc__) && __GNUC__
#define GNUC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) #define GNUC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#if (GNUC_VERSION >= 40100) || defined(__clang__) #if (GNUC_VERSION >= 40100) || defined(__clang__)
#define HAVE_ATOMIC #define HAVE_ATOMIC
......
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