Go to file
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
bin jemalloc cpp new/delete bindings 2016-12-12 18:36:06 -08:00
build-aux Update config.{guess,sub} from upstream. 2016-11-10 15:02:05 -08:00
doc Implement arena.<i>.destroy . 2017-01-06 18:58:46 -08:00
include Introduce a backport of C11 atomics 2017-03-03 13:40:59 -08:00
m4 jemalloc cpp new/delete bindings 2016-12-12 18:36:06 -08:00
msvc Update brace style. 2017-01-20 21:43:07 -08:00
scripts Dodge 32-bit-clang-specific backtracing failure. 2017-02-28 10:59:27 -08:00
src Introduce a backport of C11 atomics 2017-03-03 13:40:59 -08:00
test Introduce a backport of C11 atomics 2017-03-03 13:40:59 -08:00
.appveyor.yml CI: Run --enable-debug builds on windows 2017-01-31 17:23:30 -08:00
.autom4te.cfg Disable autom4te cache. 2014-09-02 17:49:29 -07:00
.gitattributes fix git handling of newlines on windows 2014-05-07 18:48:39 -04:00
.gitignore jemalloc cpp new/delete bindings 2016-12-12 18:36:06 -08:00
.travis.yml Beef up travis CI integration testing 2017-01-26 21:31:21 -08:00
autogen.sh Move repo contents in jemalloc/ to top level. 2011-03-31 20:36:17 -07:00
ChangeLog Fix typos. 2017-03-01 15:31:30 -08:00
config.stamp.in Move repo contents in jemalloc/ to top level. 2011-03-31 20:36:17 -07:00
configure.ac Introduce a backport of C11 atomics 2017-03-03 13:40:59 -08:00
COPYING Update copyright dates for 2016. 2016-02-28 15:20:40 -08:00
coverage.sh Add test code coverage analysis. 2013-12-06 18:50:51 -08:00
INSTALL Add huge page configuration and pages_[no}huge(). 2016-12-26 17:59:34 -08:00
jemalloc.pc.in Update project URL. 2016-09-12 11:56:24 -07:00
Makefile.in Introduce a backport of C11 atomics 2017-03-03 13:40:59 -08:00
README Update project URL. 2016-09-12 11:56:24 -07:00
run_tests.sh Introduce scripts to run all possible tests 2017-01-30 17:51:57 -08:00

jemalloc is a general purpose malloc(3) implementation that emphasizes
fragmentation avoidance and scalable concurrency support.  jemalloc first came
into use as the FreeBSD libc allocator in 2005, and since then it has found its
way into numerous applications that rely on its predictable behavior.  In 2010
jemalloc development efforts broadened to include developer support features
such as heap profiling and extensive monitoring/tuning hooks.  Modern jemalloc
releases continue to be integrated back into FreeBSD, and therefore versatility
remains critical.  Ongoing development efforts trend toward making jemalloc
among the best allocators for a broad range of demanding applications, and
eliminating/mitigating weaknesses that have practical repercussions for real
world applications.

The COPYING file contains copyright and licensing information.

The INSTALL file contains information on how to configure, build, and install
jemalloc.

The ChangeLog file contains a brief summary of changes for each release.

URL: http://jemalloc.net/