Allow atomic memory count update with C11 builtins
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.

erwin00776/redis-2.8-optimize,nandhanurrevanth/redis,Jonavin/redis,janeasystems/redis,laurencee/redis,alpha8/redis,miminus/redis,jaambee/redis,janeasystems/redis,enginekit/redis,kolonse/redis,LittlePeng/redis,jaambee/redis,damy/redis,kolonse/redis,adamweixuan/redis,laurencee/redis,hanmichael/redis,nandhanurrevanth/redis,ideaar/redis,janeasystems/redis,Jonavin/redis,fanxu/redis,erwin00776/redis-2.8-optimize,jacklee0810/redis,jqk6/redis,janeasystems/redis,miminus/redis,sidsen/redis,damy/redis,damy/redis,alpha8/redis,Cybermaxs/redis,quangnguyen90/redis,sidsen/redis,ideaar/redis,laurencee/redis,adamweixuan/redis,alpha8/redis,adamweixuan/redis,alpha8/redis,jqk6/redis,fanxu/redis,quangnguyen90/redis,janeasystems/redis,miminus/redis,Cybermaxs/redis,liqiang199105/redis,erwin00776/redis-2.8-optimize,jqk6/redis,LittlePeng/redis,enginekit/redis,ideaar/redis,shanegxxiao/redis,jaambee/redis,damy/redis,damy/redis,shanegxxiao/redis,upsoft/redis,StartTheShift/redis-shift,enginekit/redis,Cybermaxs/redis,fanxu/redis,jacklee0810/redis,sidsen/redis,upsoft/redis,nandhanurrevanth/redis,liqiang199105/redis,kolonse/redis,kts12345/redis,nandhanurrevanth/redis,fanxu/redis,miminus/redis,ideaar/redis,ScottKaiGu/redis,jaambee/redis,upsoft/redis,hanmichael/redis,jacklee0810/redis,alpha8/redis,StartTheShift/redis-shift,adamweixuan/redis,adamweixuan/redis,jqk6/redis,sidsen/redis,Cybermaxs/redis,shanegxxiao/redis,liqiang199105/redis,liqiang199105/redis,jaambee/redis,ScottKaiGu/redis,erwin00776/redis-2.8-optimize,Jonavin/redis,ScottKaiGu/redis,hanmichael/redis,upsoft/redis,ideaar/redis,enginekit/redis,laurencee/redis,kts12345/redis,hanmichael/redis,Jonavin/redis,miminus/redis,Jonavin/redis,laurencee/redis,sidsen/redis,kts12345/redis,StartTheShift/redis-shift,quangnguyen90/redis,jacklee0810/redis,LittlePeng/redis,quangnguyen90/redis,shanegxxiao/redis,liqiang199105/redis,kolonse/redis,ScottKaiGu/redis,shanegxxiao/redis,jacklee0810/redis,kts12345/redis,nandhanurrevanth/redis,ScottKaiGu/redis,jqk6/redis,sidsen/redis,hanmichael/redis,kts12345/redis,Cybermaxs/redis,upsoft/redis,quangnguyen90/redis,kolonse/redis,enginekit/redis