server-skynet-source-3rd-je.../test/unit
David Goldblatt d4ac7582f3 Introduce a backport of C11 atomics
This introduces a backport of C11 atomics.  It has four implementations; ranked
in order of preference, they are:
- GCC/Clang __atomic builtins
- GCC/Clang __sync builtins
- MSVC _Interlocked builtins
- C11 atomics, from <stdatomic.h>

The primary advantages are:
- Close adherence to the standard API gives us a defined memory model.
- Type safety: atomic objects are now separate types from non-atomic ones, so
  that it's impossible to mix up atomic and non-atomic updates (which is
  undefined behavior that compilers are starting to take advantage of).
- Efficiency: we can specify ordering for operations, avoiding fences and
  atomic operations on strongly ordered architectures (example:
  `atomic_write_u32(ptr, val);` involves a CAS loop, whereas
  `atomic_store(ptr, val, ATOMIC_RELEASE);` is a plain store.

This diff leaves in the current atomics API (implementing them in terms of the
backport).  This lets us transition uses over piecemeal.

Testing:
This is by nature hard to test. I've manually tested the first three options on
Linux on gcc by futzing with the #defines manually, on freebsd with gcc and
clang, on MSVC, and on OS X with clang.  All of these were x86 machines though,
and we don't have any test infrastructure set up for non-x86 platforms.
2017-03-03 13:40:59 -08:00
..
a0.c Remove extraneous parens around return arguments. 2017-01-20 21:43:07 -08:00
arena_reset_prof.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
arena_reset_prof.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
arena_reset.c Disentangle arena and extent locking. 2017-02-01 16:43:46 -08:00
atomic.c Introduce a backport of C11 atomics 2017-03-03 13:40:59 -08:00
base.c Remove extraneous parens around return arguments. 2017-01-20 21:43:07 -08:00
bitmap.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
ckh.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
decay.c Immediately purge cached extents if decay_time is 0. 2017-03-02 19:43:06 -08:00
decay.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
extent_quantize.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
fork.c Remove extraneous parens around return arguments. 2017-01-20 21:43:07 -08:00
hash.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
junk_alloc.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
junk_alloc.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
junk_free.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
junk_free.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
junk.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
junk.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
mallctl.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
math.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
mq.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
mtx.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
nstime.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
pack.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
pack.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
pages.c Remove extraneous parens around return arguments. 2017-01-20 21:43:07 -08:00
ph.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
prng.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
prof_accum.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
prof_accum.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
prof_active.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
prof_active.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
prof_gdump.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
prof_gdump.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
prof_idump.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
prof_idump.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
prof_reset.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
prof_reset.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
prof_tctx.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
prof_tctx.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
prof_thread_name.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
prof_thread_name.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
ql.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
qr.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
rb.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
rtree.c Remove rtree support for 0 (NULL) keys. 2017-02-08 18:50:03 -08:00
SFMT.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
size_classes.c Remove extraneous parens around return arguments. 2017-01-20 21:43:07 -08:00
slab.c Disentangle arena and extent locking. 2017-02-01 16:43:46 -08:00
smoothstep.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
spin.c Enhance spin_adaptive() to yield after several iterations. 2017-02-08 18:50:03 -08:00
stats_print.c Silence harmless warnings discovered via run_tests.sh. 2017-02-01 11:29:12 -08:00
stats.c Remove extraneous parens around return arguments. 2017-01-20 21:43:07 -08:00
ticker.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
tsd.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
util.c Replace tabs following #define with spaces. 2017-01-20 21:45:53 -08:00
witness.c Add witness_assert_depth[_to_rank](). 2017-02-01 16:43:46 -08:00
zero.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
zero.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00