Matt Stancliff a953c88381 Allow atomic memory count update with C11 builtins
From mailing list post https://groups.google.com/forum/#!topic/redis-db/QLjiQe4D7LA

In zmalloc.c the following primitives are currently used
to synchronize access to single global variable:
__sync_add_and_fetch
__sync_sub_and_fetch

In some architectures such as powerpc these primitives are overhead
intensive. More efficient C11 __atomic builtins are available with
newer GCC versions, see
http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/_005f_005fatomic-Builtins.html#_005f_005fatomic-Builtins

By substituting the following  __atomic… builtins:
__atomic_add_fetch
__atomic_sub_fetch

the performance improvement on certain architectures such as powerpc can be significant,
around 10% to 15%, over the implementation using __sync builtins while there is only slight uptick on
Intel architectures because it was already enforcing Intel Strongly ordered memory semantics.

The selection of __atomic built-ins can be predicated on the definition of ATOMIC_RELAXED
which Is available on in gcc 4.8.2 and later versions.
2014-06-26 08:52:53 -04:00
..
2012-04-13 17:52:33 -07:00
2013-01-19 10:59:44 +01:00
2013-01-19 10:59:44 +01:00
2014-06-16 10:43:05 +02:00
2014-05-07 16:12:32 +02:00
2013-01-19 10:59:44 +01:00
2014-04-22 16:14:38 +02:00
2013-01-19 10:59:44 +01:00
2014-03-28 12:11:55 +01:00
2014-05-12 11:11:09 -04:00
2014-03-20 16:20:37 +01:00
2013-01-19 10:59:44 +01:00
2014-06-17 21:59:12 -07:00
2014-06-23 11:44:34 +02:00
2013-01-19 10:59:44 +01:00
2014-01-22 09:54:55 +01:00
2013-07-16 15:43:36 +02:00
2014-06-23 12:07:41 +02:00
2013-01-19 10:59:44 +01:00
2014-06-01 02:23:24 +08:00
2013-07-02 12:08:07 +02:00
2011-07-06 15:22:00 +02:00
2013-09-03 15:15:51 +02:00