summaryrefslogtreecommitdiffstats
path: root/include/jemalloc/internal/atomic.h
Commit message (Collapse)AuthorAgeFilesLines
* Refactor arenas array (fixes deadlock).Jason Evans2016-02-251-2/+2
| | | | | | | | | | | | Refactor the arenas array, which contains pointers to all extant arenas, such that it starts out as a sparse array of maximum size, and use double-checked atomics-based reads as the basis for fast and simple arena_get(). Additionally, reduce arenas_lock's role such that it only protects against arena initalization races. These changes remove the possibility for arena lookups to trigger locking, which resolves at least one known (fork-related) deadlock. This resolves #315.
* Fix type errors in C11 versions of atomic_*() functions.Chi-hung Hsieh2015-05-281-8/+8
|
* Use InterlockedCompareExchange instead of non-existing ↵Mike Hommey2015-03-171-1/+1
| | | | InterlockedCompareExchange32
* Move centralized chunk management into arenas.Jason Evans2015-02-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrate all centralized data structures related to huge allocations and recyclable chunks into arena_t, so that each arena can manage huge allocations and recyclable virtual memory completely independently of other arenas. Add chunk node caching to arenas, in order to avoid contention on the base allocator. Use chunks_rtree to look up huge allocations rather than a red-black tree. Maintain a per arena unsorted list of huge allocations (which will be needed to enumerate huge allocations during arena reset). Remove the --enable-ivsalloc option, make ivsalloc() always available, and use it for size queries if --enable-debug is enabled. The only practical implications to this removal are that 1) ivsalloc() is now always available during live debugging (and the underlying radix tree is available during core-based debugging), and 2) size query validation can no longer be enabled independent of --enable-debug. Remove the stats.chunks.{current,total,high} mallctls, and replace their underlying statistics with simpler atomically updated counters used exclusively for gdump triggering. These statistics are no longer very useful because each arena manages chunks independently, and per arena statistics provide similar information. Simplify chunk synchronization code, now that base chunk allocation cannot cause recursive lock acquisition.
* Remove unnecessary xchg* lock prefixes.Jason Evans2015-02-111-2/+2
|
* Implement more atomic operations.Jason Evans2015-02-051-82/+384
| | | | | | - atomic_*_p(). - atomic_cas_*(). - atomic_write_*().
* Add a C11 atomics-based implementation of atomic.h API.Chih-hung Hsieh2014-12-071-0/+28
|
* Style fixes.Jason Evans2014-12-061-2/+2
|
* Add atomic operations tests and fix latent bugs.Jason Evans2014-08-071-12/+29
|
* Add support for MSVCMike Hommey2012-05-011-0/+28
| | | | Tested with MSVC 8 32 and 64 bits.
* Add atomic(9) implementations of atomic operations.Jason Evans2012-04-171-5/+41
| | | | | Add atomic(9) implementations of atomic operations. These are used on FreeBSD for non-x86 architectures.
* Use __sync_add_and_fetch and __sync_sub_and_fetch when they are availableMike Hommey2012-03-261-3/+15
| | | | | | | These functions may be available as inlines or as libgcc functions. In the former case, a __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n macro is defined. But we still want to use these functions in the latter case, when we don't have our own implementation.
* Remove ephemeral mutexes.Jason Evans2012-03-241-0/+30
| | | | | | | | | | | Remove ephemeral mutexes from the prof machinery, and remove malloc_mutex_destroy(). This simplifies mutex management on systems that call malloc()/free() inside pthread_mutex_{create,destroy}(). Add atomic_*_u() for operation on unsigned values. Fix prof_printf() to call malloc_vsnprintf() rather than malloc_snprintf().
* Restructure atomic_*_z().Jason Evans2012-03-231-16/+29
| | | | | Restructure atomic_*_z() so that no casting within macros is necessary. This avoids warnings when compiling with clang.
* Add SH4 and mips architecture support.Jason Evans2012-03-051-0/+16
| | | | Submitted by Andreas Vinsander.
* Simplify small size class infrastructure.Jason Evans2012-02-291-2/+2
| | | | | | | | | | | | Program-generate small size class tables for all valid combinations of LG_TINY_MIN, LG_QUANTUM, and PAGE_SHIFT. Use the appropriate table to generate all relevant data structures, and remove the distinction between tiny/quantum/cacheline/subpage bins. Remove --enable-dynamic-page-shift. This option didn't prove useful in practice, and it prevented optimizations. Add Tilera architecture support.
* Move repo contents in jemalloc/ to top level.Jason Evans2011-04-011-0/+169