summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add witness, a simple online locking validator.Jason Evans2016-04-1433-1274/+2090
| | | | This resolves #358.
* Fix a style nit.Jason Evans2016-04-131-1/+2
|
* Fix more 64-to-32 conversion warnings.Jason Evans2016-04-122-11/+11
|
* Fix 64-to-32 conversion warnings in 32-bit moderustyx2016-04-121-11/+15
|
* Cleanup MSVC project, embed PDB data inside static .librustyx2016-04-122-14/+11
|
* Fix malloc_stats_print() to print correct opt.narenas value.Jason Evans2016-04-121-1/+1
| | | | | This regression was caused by 8f683b94a751c65af8f9fa25970ccf2917b96bb8 (Make opt_narenas unsigned rather than size_t.).
* Simplify RTREE_HEIGHT_MAX definition.Jason Evans2016-04-111-29/+4
| | | | | Use 1U rather than ZU(1) in macro definitions, so that the preprocessor can evaluate the resulting expressions.
* Support --with-lg-page values larger than actual page size.Jason Evans2016-04-114-6/+6
| | | | | | | | | | | | | | During over-allocation in preparation for creating aligned mappings, allocate one more page than necessary if PAGE is the actual page size, so that trimming still succeeds even if the system returns a mapping that has less than PAGE alignment. This allows compiling with e.g. 64 KiB "pages" on systems that actually use 4 KiB pages. Note that for e.g. --with-lg-page=21, it is also necessary to increase the chunk size (e.g. --with-malloc-conf=lg_chunk:22) so that there are at least two "pages" per chunk. In practice this isn't a particularly compelling configuration because so much (unusable) virtual memory is dedicated to chunk headers.
* Clean up char vs. uint8_t in junk filling code.Jason Evans2016-04-113-17/+19
| | | | Consistently use uint8_t rather than char for junk filling code.
* Refactor/fix ph.Jason Evans2016-04-118-337/+615
| | | | | | | | | | | | | | | | | | | | | Refactor ph to support configurable comparison functions. Use a cpp macro code generation form equivalent to the rb macros so that pairing heaps can be used for both run heaps and chunk heaps. Remove per node parent pointers, and instead use leftmost siblings' prev pointers to track parents. Fix multi-pass sibling merging to iterate over intermediate results using a FIFO, rather than a LIFO. Use this fixed sibling merging implementation for both merge phases of the auxiliary twopass algorithm (first merging the aux list, then replacing the root with its merged children). This fixes both degenerate merge behavior and the potential for deep recursion. This regression was introduced by 6bafa6678fc36483e638f1c3a0a9bf79fb89bfc9 (Pairing heap). This resolves #371.
* Reduce differences between alternative bitmap implementations.Jason Evans2016-04-062-8/+5
|
* Fix bitmap_sfu() regression.Jason Evans2016-04-061-1/+1
| | | | | | | | | | | | Fix bitmap_sfu() to shift by LG_BITMAP_GROUP_NBITS rather than hard-coded 6 when using linear (non-USE_TREE) bitmap search. In practice this affects only 64-bit systems for which sizeof(long) is not 8 (i.e. Windows), since USE_TREE is defined for 32-bit systems. This regression was caused by b8823ab02607d6f03febd32ac504bb6188c54047 (Use linear scan for small bitmaps). This resolves #368.
* Fix a compilation warning in the ph test code.Jason Evans2016-04-051-20/+1
|
* Update implementation details docs re: PTRDIFF_MAX.Jason Evans2016-03-311-3/+11
| | | | | | | Document that the maximum size class is limited by PTRDIFF_MAX, rather than the full address space. This reflects changes that were part of 0c516a00c4cb28cff55ce0995f756b5aae074c9e (Make *allocx() size class overflow behavior defined.).
* 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
| |