summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Refactor (MALLOCX_ARENA_MAX + 1) to be MALLOCX_ARENA_LIMIT.Jason Evans2017-05-144-6/+6
| | | | This resolves #673.
* Automatically generate private symbol name mangling macros.Jason Evans2017-05-125-611/+71
| | | | | | | | Rather than using a manually maintained list of internal symbols to drive name mangling, add a compilation phase to automatically extract the list of internal symbols. This resolves #677.
* Remove unused private_unnamespace infrastructure.Jason Evans2017-05-121-5/+0
|
* Stop depending on JEMALLOC_N() for function interception during testing.Jason Evans2017-05-127-114/+106
| | | | | | Instead, always define function pointers for interceptable functions, but mark them const unless testing, so that the compiler can optimize out the pointer dereferences.
* Avoid compiler warnings on Windows.Jason Evans2017-05-121-5/+5
|
* Remove mutex_prof_data_t redeclaration.Jason Evans2017-05-112-2/+1
| | | | | | | Redeclaration causes compilations failures with e.g. gcc 4.2.1 on FreeBSD. This regression was introduced by 89e2d3c12b573310e60b97beaf178007a71d83a3 (Header refactoring: ctl - unify and remove from catchall.).
* Fix rtree_leaf_elm_szind_slab_update().Jason Evans2017-05-031-8/+7
| | | | | | | | | | | Re-read the leaf element when atomic CAS fails due to a race with another thread that has locked the leaf element, since atomic_compare_exchange_strong_p() overwrites the expected value with the actual value on failure. This regression was introduced by 0ee0e0c155a05d0d028a9972ad86b9eaac4ccabd (Implement compact rtree leaf element representation.). This resolves #798.
* rtree_leaf_elm_extent_write() --> rtree_leaf_elm_extent_lock_write()Jason Evans2017-05-031-8/+9
| | | | | | | Refactor rtree_leaf_elm_extent_write() as rtree_leaf_elm_extent_lock_write(), so that whether the leaf element is currently acquired is separate from what lock state to write. This allows for a relaxed atomic read when releasing the lock.
* Revert "Use trylock in tcache_bin_flush when possible."Qi Wang2017-05-012-19/+15
| | | | | This reverts commit 8584adc451f31adfc4ab8693d9189cf3a7e5d858. Production results not favorable. Will investigate separately.
* Header refactoring: tsd - cleanup and dependency breaking.David Goldblatt2017-05-0123-830/+773
| | | | | | | | | | | | This removes the tsd macros (which are used only for tsd_t in real builds). We break up the circular dependencies involving tsd. We also move all tsd access through getters and setters. This allows us to assert that we only touch data when tsd is in a valid state. We simplify the usages of the x macro trick, removing all the customizability (get/set, init, cleanup), moving the lifetime logic to tsd_init and tsd_cleanup. This lets us make initialization order independent of order within tsd_t.
* Add extent_destroy_t and use it during arena destruction.Jason Evans2017-04-293-3/+12
| | | | | | | | | | Add the extent_destroy_t extent destruction hook to extent_hooks_t, and use it during arena destruction. This hook explicitly communicates to the callee that the extent must be destroyed or tracked for later reuse, lest it be permanently leaked. Prior to this change, retained extents could unintentionally be leaked if extent retention was enabled. This resolves #560.
* Refactor !opt.munmap to opt.retain.Jason Evans2017-04-295-13/+11
|
* Revert "Use try_flush first in tcache_dalloc."Qi Wang2017-04-281-10/+4
| | | | | | This reverts commit b0c2a28280d363fc85aa8b4fdbe7814ef46cb17b. Production benchmark shows this caused significant regression in both CPU and memory consumption. Will investigate separately later on.
* Use try_flush first in tcache_dalloc.Qi Wang2017-04-261-4/+10
| | | | Only do must_flush if try_flush didn't manage to free anything.
* Use trylock in tcache_bin_flush when possible.Qi Wang2017-04-262-15/+19
| | | | | During tcache gc, use tcache_bin_try_flush_small / _large so that we can skip items with their bins locked already.
* Avoid prof_dump during reentrancy.Qi Wang2017-04-251-0/+3
|
* Header refactoring: pages.h - unify and remove from catchall.David Goldblatt2017-04-255-34/+30
|
* Header refactoring: hash - unify and remove from catchall.David Goldblatt2017-04-252-4/+3
|
* Header refactoring: ctl - unify and remove from catchall.David Goldblatt2017-04-258-227/+216
| | | | | In order to do this, we introduce the mutex_prof module, which breaks a circular dependency between ctl and prof.
* Replace --disable-munmap with opt.munmap.Jason Evans2017-04-254-14/+10
| | | | | | | | | Control use of munmap(2) via a run-time option rather than a compile-time option (with the same per platform default). The old behavior of --disable-munmap can be achieved with --with-malloc-conf=munmap:false. This partially resolves #580.
* Remove --enable-code-coverage.Jason Evans2017-04-242-4/+1
| | | | | | | This option hasn't been particularly useful since the original pre-3.0.0 push to broaden test coverage. This partially resolves #580.
* Remove --disable-cc-silence.Jason Evans2017-04-243-13/+2
| | | | | | | The explicit compiler warning suppression controlled by this option is universally desirable, so remove the ability to disable suppression. This partially resolves #580.
* Implement malloc_mutex_trylock() w/ proper stats update.Qi Wang2017-04-242-12/+34
|
* Remove --with-lg-tiny-min.Jason Evans2017-04-242-3/+2
| | | | | | This option isn't useful in practice. This partially resolves #580.
* Header refactoring: bitmap - unify and remove from catchall.David Goldblatt2017-04-249-387/+373
|
* Header refactoring: stats - unify and remove from catchallDavid Goldblatt2017-04-248-35/+29
|
* Header refactoring: move smoothstep.h out of the catchall.David Goldblatt2017-04-242-1/+1
|
* Header refactoring: size_classes module - remove from the catchallDavid Goldblatt2017-04-2416-1/+24
|
* Header refactoring: ckh module - remove from the catchall and unify.David Goldblatt2017-04-246-84/+102
|
* Header refactoring: ticker module - remove from the catchall and unify.David Goldblatt2017-04-249-21/+21
|
* Header refactoring: prng module - remove from the catchall and unify.David Goldblatt2017-04-245-35/+48
|
* Get rid of most of the various inline macros.David Goldblatt2017-04-2419-544/+134
|
* Enable -Wundef, when supported.David Goldblatt2017-04-222-0/+4
| | | | | | This can catch bugs in which one header defines a numeric constant, and another uses it without including the defining header. Undefined preprocessor symbols expand to '0', so that this will compile fine, silently doing the math wrong.
* Remove --enable-ivsalloc.Jason Evans2017-04-212-13/+11
| | | | | | | | | | | | Continue to use ivsalloc() when --enable-debug is specified (and add assertions to guard against 0 size), but stop providing a documented explicit semantics-changing band-aid to dodge undefined behavior in sallocx() and malloc_usable_size(). ivsalloc() remains compiled in, unlike when #211 restored --enable-ivsalloc, and if JEMALLOC_FORCE_IVSALLOC is defined during compilation, sallocx() and malloc_usable_size() will still use ivsalloc(). This partially resolves #580.
* Use openat syscall if availableJim Chen2017-04-211-0/+5
| | | | | | | | | | Some architectures like AArch64 may not have the open syscall because it was superseded by the openat syscall, so check and use SYS_openat if SYS_open is not available. Additionally, Android headers for AArch64 define SYS_open to __NR_open, even though __NR_open is undefined. Undefine SYS_open in that case so SYS_openat is used.
* Remove --disable-tcache.Jason Evans2017-04-217-42/+9
| | | | | | | | | | | Simplify configuration by removing the --disable-tcache option, but replace the testing for that configuration with --with-malloc-conf=tcache:false. Fix the thread.arena and thread.tcache.flush mallctls to work correctly if tcache is disabled. This partially resolves #580.
* Bypass extent tracking for auto arenas.Qi Wang2017-04-213-6/+10
| | | | | | | | Tracking extents is required by arena_reset. To support this, the extent linkage was used for tracking 1) large allocations, and 2) full slabs. However modifying the extent linkage could be an expensive operation as it likely incurs cache misses. Since we forbid arena_reset on auto arenas, let's bypass the linkage operations for auto arenas.
* Support --with-lg-page values larger than system page size.Jason Evans2017-04-192-5/+2
| | | | | | | | | All mappings continue to be PAGE-aligned, even if the system page size is smaller. This change is primarily intended to provide a mechanism for supporting multiple page sizes with the same binary; smaller page sizes work better in conjunction with jemalloc's design. This resolves #467.
* Revert "Remove BITMAP_USE_TREE."Jason Evans2017-04-193-0/+213
| | | | | | | | | Some systems use a native 64 KiB page size, which means that the bitmap for the smallest size class can be 8192 bits, not just 512 bits as when the page size is 4 KiB. Linear search in bitmap_{sfu,ffu}() is unacceptably slow for such large bitmaps. This reverts commit 7c00f04ff40a34627e31488d02ff1081c749c7ba.
* Header refactoring: unify spin.h and move it out of the catch-all.David Goldblatt2017-04-196-48/+38
|
* Header refactoring: unify nstime.h and move it out of the catch-allDavid Goldblatt2017-04-197-26/+17
|
* Header refactoring: move jemalloc_internal_types.h out of the catch-allDavid Goldblatt2017-04-196-3/+9
|
* Header refactoring: move assert.h out of the catch-allDavid Goldblatt2017-04-192-6/+2
|
* Header refactoring: move util.h out of the catchallDavid Goldblatt2017-04-192-1/+2
|
* Header refactoring: move malloc_io.h out of the catchallDavid Goldblatt2017-04-192-1/+2
|
* Header refactoring: move bit_util.h out of the catchallDavid Goldblatt2017-04-194-1/+4
|
* Move CPP_PROLOGUE and CPP_EPILOGUE to the .cppDavid Goldblatt2017-04-194-21/+0
| | | | This lets us avoid having to specify them in every C file.
* Prefer old/low extent_t structures during reuse.Jason Evans2017-04-176-15/+57
| | | | | | Rather than using a LIFO queue to track available extent_t structures, use a red-black tree, and always choose the oldest/lowest available during reuse.
* Track extent structure serial number (esn) in extent_t.Jason Evans2017-04-174-16/+75
| | | | This enables stable sorting of extent_t structures.
* Allocate increasingly large base blocks.Jason Evans2017-04-171-1/+8
| | | | | Limit the total number of base block by leveraging the exponential size class sequence, similarly to extent_grow_retained().