summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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.).
| * Cast PTRDIFF_MAX to size_t before adding 1.Jason Evans2016-02-263-10/+10
| | | | | | | | | | | | This fixes compilation warnings regarding integer overflow that were introduced by 0c516a00c4cb28cff55ce0995f756b5aae074c9e (Make *allocx() size class overflow behavior defined.).
| * Make *allocx() size class overflow behavior defined.Jason Evans2016-02-2514-89/+247
| | | | | | | | | | | | | | Limit supported size and alignment to HUGE_MAXCLASS, which in turn is now limited to be less than PTRDIFF_MAX. This resolves #278 and #295.
| * Refactor arenas array (fixes deadlock).Jason Evans2016-02-259-211/+159
| | | | | | | | | | | | | | | | | | | | | | | | 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 arena_size computation.Dave Watson2016-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix arena_size arena_new() computation to incorporate runs_avail_nclasses elements for runs_avail, rather than (runs_avail_nclasses - 1) elements. Since offsetof(arena_t, runs_avail) is used rather than sizeof(arena_t) for the first term of the computation, all of the runs_avail elements must be added into the second term. This bug was introduced (by Jason Evans) while merging pull request #330 as 3417a304ccde61ac1f68b436ec22c03f1d6824ec (Separate arena_avail trees).
| * Fix arena_run_first_best_fitDave Watson2016-02-251-1/+1
| | | | | | | | | | | | Merge of 3417a304ccde61ac1f68b436ec22c03f1d6824ec looks like a small bug: first_best_fit doesn't scan through all the classes, since ind is offset from runs_avail_nclasses by run_avail_bias.
| * Attempt mmap-based in-place huge reallocation.Jason Evans2016-02-253-13/+12
| | | | | | | | | | | | | | | | Attempt mmap-based in-place huge reallocation by plumbing new_addr into chunk_alloc_mmap(). This can dramatically speed up incremental huge reallocation. This resolves #335.
| * Document the heap profile format.Jason Evans2016-02-241-1/+49
| | | | | | | | This resolves #258.
| * Update manual to reflect removal of global huge object tree.Jason Evans2016-02-241-16/+11
| | | | | | | | This resolves #323.
| * Fix ffs_zu() compilation error on MinGW.Jason Evans2016-02-241-3/+5
| | | | | | | | | | This regression was caused by 9f4ee6034c3ac6a8c8b5f9a0d76822fb2fd90c41 (Refactor jemalloc_ffs*() into ffs_*().).
| * Silence miscellaneous 64-to-32-bit data loss warnings.Jason Evans2016-02-242-2/+6
| |
| * Compile with -Wshorten-64-to-32.Jason Evans2016-02-241-0/+1
| | | | | | | | | | This will prevent accidental creation of potential integer truncation bugs when developing on LP64 systems.
| * Silence miscellaneous 64-to-32-bit data loss warnings.Jason Evans2016-02-2413-41/+49
| |
| * Change lg_floor() return type from size_t to unsigned.Jason Evans2016-02-242-17/+18
| |
| * Use ssize_t for readlink() rather than int.Jason Evans2016-02-241-1/+1
| |
| * Make opt_narenas unsigned rather than size_t.Jason Evans2016-02-246-14/+24
| |
| * Make nhbins unsigned rather than size_t.Jason Evans2016-02-242-2/+2
| |
| * Explicitly cast mib[] elements to unsigned where appropriate.Jason Evans2016-02-241-9/+9
| |
| * Refactor jemalloc_ffs*() into ffs_*().Jason Evans2016-02-248-40/+70
| | | | | | | | Use appropriate versions to resolve 64-to-32-bit data loss warnings.
| * Fix Windows build issuesDmitri Smirnov2016-02-244-6/+31
| | | | | | | | This resolves #333.
| * Collapse arena_avail_tree_* into arena_run_tree_*.Jason Evans2016-02-242-13/+8
| | | | | | | | | | These tree types converged to become identical, yet they still had independently generated red-black tree implementations.
| * Separate arena_avail treesDave Watson2016-02-242-94/+56
| | | | | | | | | | | | | | | | | | | | | | Separate run trees by index, replacing the previous quantize logic. Quantization by index is now performed only on insertion / removal from the tree, and not on node comparison, saving some cpu. This also means we don't have to dereference the miscelm* pointers, saving half of the memory loads from miscelms/mapbits that have fallen out of cache. A linear scan of the indicies appears to be fast enough. The only cost of this is an extra tree array in each arena.