summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add JEMALLOC_ALLOC_JUNK and JEMALLOC_FREE_JUNK macrosChris Peterson2016-03-317-32/+40
| | | | | Replace hardcoded 0xa5 and 0x5a junk values with JEMALLOC_ALLOC_JUNK and JEMALLOC_FREE_JUNK macros, respectively.
* Update a comment.Jason Evans2016-03-311-2/+2
|
* Fix potential chunk leaks.Jason Evans2016-03-315-51/+26
| | | | | | | | | | | | Move chunk_dalloc_arena()'s implementation into chunk_dalloc_wrapper(), so that if the dalloc hook fails, proper decommit/purge/retain cascading occurs. This fixes three potential chunk leaks on OOM paths, one during dss-based chunk allocation, one during chunk header commit (currently relevant only on Windows), and one during rtree write (e.g. if rtree node allocation fails). Merge chunk_purge_arena() into chunk_purge_default() (refactor, no change to functionality).
* Fix -Wunreachable-code warning in malloc_vsnprintf().Chris Peterson2016-03-271-2/+2
| | | | | | | | | | | Variables s and slen are declared inside a switch statement, but outside a case scope. clang reports these variable definitions as "unreachable", though this is not really meaningful in this case. This is the only -Wunreachable-code warning in jemalloc. src/util.c:501:5 [-Wunreachable-code] code will never be executed This resolves #364.
* Remove unused arenas_extend() function declaration.Chris Peterson2016-03-261-1/+0
| | | | | | The arenas_extend() function was renamed to arenas_init() in commit 8bb3198f72fc7587dc93527f9f19fb5be52fa553, but its function declaration was not removed from jemalloc_internal.h.in.
* Use abort() for fallback implementations of unreachable().Jason Evans2016-03-241-2/+2
|
* Fix MSVC projectrustyx2016-03-242-0/+8
|
* Avoid blindly enabling assertions for header code when testing.Jason Evans2016-03-231-33/+45
| | | | | | Restructure the test program master header to avoid blindly enabling assertions. Prior to this change, assertion code in e.g. arena.h was always enabled for tests, which could skew performance-related testing.
* Constify various internal arena APIs.Jason Evans2016-03-234-73/+111
|
* Code formatting fixes.Jason Evans2016-03-232-2/+4
|
* Always inline performance-critical rtree operations.Jason Evans2016-03-231-9/+10
|
* Optimize rtree_get().Jason Evans2016-03-233-35/+134
| | | | | | | Specialize fast path to avoid code that cannot execute for dependent loads. Manually unroll.
* Enable -Wsign-compare warnings.Chris Peterson2016-03-151-0/+1
|
* Refactor out signed/unsigned comparisons.Jason Evans2016-03-155-18/+14
|
* Add --with-version.Jason Evans2016-03-152-20/+33
| | | | | | Also avoid deleting the VERSION file while trying to (re)generate it. This resolves #305.
* Add (size_t) casts to MALLOCX_ALIGN().Jason Evans2016-03-112-17/+14
| | | | | | | | Add (size_t) casts to MALLOCX_ALIGN() macros so that passing the integer constant 0x80000000 does not cause a compiler warning about invalid shift amount. This resolves #354.
* typecast address to pointer to byte to avoid unaligned memory access errorRajeev Misra2016-03-111-2/+2
|
* Convert arena_bin_t's runs from a tree to a heap.Jason Evans2016-03-082-49/+23
|
* Use pairing heap for arena->runs_availDave Watson2016-03-083-18/+40
| | | | | | | | | | | | | | Use pairing heap instead of red black tree in arena runs_avail. The extra links are unioned with the bitmap_t, so this change doesn't use any extra memory. Canaries show this change to be a 1% cpu win, and 2% latency win. In particular, large free()s, and small bin frees are now O(1) (barring coalescing). I also tested changing bin->runs to be a pairing heap, but saw a much smaller win, and it would mean increasing the size of arena_run_s by two pointers, so I left that as an rb-tree for now.
* Refactor ph_merge_ordered() out of ph_merge().Jason Evans2016-03-082-17/+23
|
* Unittest for pairing heapDave Watson2016-03-082-0/+93
|
* Pairing heapDave Watson2016-03-085-0/+270
| | | | | | | | | | | | | | | Initial implementation of a twopass pairing heap with aux list. Research papers linked in comments. Where search/nsearch/last aren't needed, this gives much faster first(), delete(), and insert(). Insert is O(1), and first/delete don't have to walk the whole tree. Also tested rb_old with parent pointers - it was better than the current rb.h for memory loads, but still much worse than a pairing heap. An array-based heap would be much faster if everything fits in memory, but on a cold cache it has many more memory loads for most operations.
* Replace contributor name with github account.Jason Evans2016-03-081-2/+2
|
* Avoid a potential innocuous compiler warning.Jason Evans2016-03-032-2/+6
| | | | | | | Add a cast to avoid comparing a ssize_t value to a uint64_t value that is always larger than a 32-bit ssize_t. This silences an innocuous compiler warning from e.g. gcc 4.2.1 about the comparison always having the same result.
* Fix stack corruption and uninitialized var warningDmitri Smirnov2016-02-292-7/+8
| | | | | | Stack corruption happens in x64 bit This resolves #347.
* Fix MSVC project and improve MSVC lib naming (v140 -> vc140)rustyx2016-02-293-7/+23
|
* Remove errno overrides.Dmitri Smirnov2016-02-291-21/+1
|
* Update copyright dates for 2016.Jason Evans2016-02-281-2/+2
|
* Merge branch 'dev'4.1.0Jason Evans2016-02-2885-1590/+6236
|\
| * Update ChangeLog for 4.1.0.Jason Evans2016-02-281-1/+1
| |
| * Make test_threads more genericrustyx2016-02-281-66/+55
| |
| * Update ChangeLog.Jason Evans2016-02-281-7/+10
| |
| * Fix decay tests for --disable-tcache case.Jason Evans2016-02-281-6/+14
| |
| * Fix a potential tsd cleanup leak.Jason Evans2016-02-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to 767d85061a6fb88ec977bbcd9b429a43aff391e6 (Refactor arenas array (fixes deadlock).), it was possible under some circumstances for arena_get() to trigger recreation of the arenas cache during tsd cleanup, and the arenas cache would then be leaked. In principle a similar issue could still occur as a side effect of decay-based purging, which calls arena_tdata_get(). Fix arenas_tdata_cleanup() by setting tsd->arenas_tdata_bypass to true, so that arena_tdata_get() will gracefully fail (an expected behavior) rather than recreating tsd->arena_tdata. Reported by Christopher Ferris <cferris@google.com>.
| * Fix stats.arenas.<i>.[...] for --disable-stats case.Jason Evans2016-02-286-86/+120
| | | | | | | | | | | | | | | | Add missing stats.arenas.<i>.{dss,lg_dirty_mult,decay_time} initialization. Fix stats.arenas.<i>.{pactive,pdirty} to read under the protection of the arena mutex.
| * Fix decay tests for --disable-stats case.Jason Evans2016-02-281-11/+18
| |
| * Add/alphabetize private symbols.Jason Evans2016-02-271-15/+15
| |
| * Fix stats.cactive accounting regression.Jason Evans2016-02-272-33/+29
| | | | | | | | | | | | | | | | | | | | Fix stats.cactive accounting to always increase/decrease by multiples of the chunk size, even for huge size classes that are not multiples of the chunk size, e.g. {2.5, 3, 3.5, 5, 7} MiB with 2 MiB chunk size. This regression was introduced by 155bfa7da18cab0d21d87aa2dce4554166836f5d (Normalize size classes.) and first released in 4.0.0. This resolves #336.
| * Update ChangeLog in preparation for 4.1.0.Jason Evans2016-02-271-0/+70
| |
| * Refactor arena_cactive_update() into arena_cactive_{add,sub}().Jason Evans2016-02-271-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes an implicit conversion from size_t to ssize_t. For cactive decreases, the size_t value was intentionally underflowed to generate "negative" values (actually positive values above the positive range of ssize_t), and the conversion to ssize_t was undefined according to C language semantics. This regression was perpetuated by 1522937e9cbcfa24c881dc439cc454f9a34a7e88 (Fix the cactive statistic.) and first release in 4.0.0, which in retrospect only fixed one of two problems introduced by aa5113b1fdafd1129c22512837c6c3d66c295fc8 (Refactor overly large/complex functions) and first released in 3.5.0.
| * Remove invalid tests.Jason Evans2016-02-272-18/+2
| | | | | | | | | | Remove invalid tests that were intended to be tests of (hugemax+1) OOM, for which tests already exist.
| * Move retaining out of default chunk hooksbuchgr2016-02-261-11/+25
| | | | | | | | | | | | | | This fixes chunk allocation to reuse retained memory even if an application-provided chunk allocation function is in use. This resolves #307.
| * Refactor some bitmap cpp logic.Jason Evans2016-02-261-3/+2
| |
| * Use linear scan for small bitmapsDave Watson2016-02-262-3/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | For small bitmaps, a linear scan of the bitmap is slightly faster than a tree search - bitmap_t is more compact, and there are fewer writes since we don't have to propogate state transitions up the tree. On x86_64 with the current settings, I'm seeing ~.5%-1% CPU improvement in production canaries with this change. The old tree code is left since 32bit sizes are much larger (and ffsl smaller), and maybe the run sizes will change in the future. This resolves #339.
| * Miscellaneous bitmap refactoring.Jason Evans2016-02-264-39/+38
| |
| * Improve test_threads performancerustyx2016-02-261-4/+4
| |
| * Fix MSVC projectrustyx2016-02-262-0/+4
| |
| * Silence miscellaneous 64-to-32-bit data loss warnings.Jason Evans2016-02-264-15/+14
| | | | | | | | This resolves #341.
| * Remove a superfluous comment.Jason Evans2016-02-261-1/+0
| |
| * Add more HUGE_MAXCLASS overflow checks.Jason Evans2016-02-261-23/+34
| | | | | | | | | | | | | | Add HUGE_MAXCLASS overflow checks that are specific to heap profiling code paths. This fixes test failures that were introduced by 0c516a00c4cb28cff55ce0995f756b5aae074c9e (Make *allocx() size class overflow behavior defined.).