summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Add/use chunk_merge_wrapper().Jason Evans2016-06-033-92/+97
|
* Add/use chunk_commit_wrapper().Jason Evans2016-06-032-30/+40
|
* Add/use chunk_decommit_wrapper().Jason Evans2016-06-032-7/+16
|
* Merge chunk_alloc_base() into its only caller.Jason Evans2016-06-032-21/+9
|
* Replace extent_tree_szad_* with extent_heap_*.Jason Evans2016-06-034-77/+158
|
* Use rtree rather than [sz]ad trees for chunk split/coalesce operations.Jason Evans2016-06-033-166/+221
|
* Remove redundant chunk argument from chunk_{,de,re}register().Jason Evans2016-06-033-20/+22
|
* Fix opt_zero-triggered in-place huge reallocation zeroing.Jason Evans2016-06-031-4/+4
| | | | | | Fix huge_ralloc_no_move_expand() to update the extent's zeroed attribute based on the intersection of the previous value and that of the newly merged trailing extent.
* Replace extent_achunk_[gs]et() with extent_slab_[gs]et().Jason Evans2016-06-034-11/+11
|
* Add extent_active_[gs]et().Jason Evans2016-06-034-11/+12
| | | | Always initialize extents' runs_dirty and chunks_cache linkage.
* Set/unset rtree node for last chunk of extents.Jason Evans2016-06-031-4/+41
| | | | | Set/unset rtree node for last chunk of extents, so that the rtree can be used for chunk coalescing.
* Add rtree element witnesses.Jason Evans2016-06-033-2/+126
|
* Refactor rtree to always use base_alloc() for node allocation.Jason Evans2016-06-038-114/+162
|
* Use rtree-based chunk lookups rather than pointer bit twiddling.Jason Evans2016-06-037-334/+352
| | | | | | | | | | | Look up chunk metadata via the radix tree, rather than using CHUNK_ADDR2BASE(). Propagate pointer's containing extent. Minimize extent lookups by doing a single lookup (e.g. in free()) and propagating the pointer's extent into nearly all the functions that may need it.
* Add element acquire/release capabilities to rtree.Jason Evans2016-06-032-17/+18
| | | | | | | | This makes it possible to acquire short-term "ownership" of rtree elements so that it is possible to read an extent pointer *and* read the extent's contents with a guarantee that the element will not be modified until the ownership is released. This is intended as a mechanism for resolving rtree read/write races rather than as a way to lock extents.
* Rename extent_node_t to extent_t.Jason Evans2016-05-166-308/+305
|
* Simplify run quantization.Jason Evans2016-05-162-152/+30
|
* Refactor runs_avail.Jason Evans2016-05-162-41/+37
| | | | | | | | Use pszind_t size classes rather than szind_t size classes, and always reserve space for NPSIZES elements. This removes unused heaps that are not multiples of the page size, and adds (currently) unused heaps for all huge size classes, with the immediate benefit that the size of arena_t allocations is constant (no longer dependent on chunk size).
* Implement pz2ind(), pind2sz(), and psz2u().Jason Evans2016-05-132-4/+5
| | | | | | | These compute size classes and indices similarly to size2index(), index2size() and s2u(), respectively, but using the subset of size classes that are multiples of the page size. Note that pszind_t and szind_t are not interchangeable.
* Initialize arena_bin_info at compile time rather than at boot time.Jason Evans2016-05-132-81/+35
| | | | This resolves #370.
* Implement BITMAP_INFO_INITIALIZER(nbits).Jason Evans2016-05-131-3/+3
| | | | This allows static initialization of bitmap_info_t structures.
* Remove redzone support.Jason Evans2016-05-134-153/+19
| | | | This resolves #369.
* Remove quarantine support.Jason Evans2016-05-136-262/+32
|
* Remove Valgrind support.Jason Evans2016-05-139-187/+15
|
* Use TSDN_NULL rather than NULL as appropriate.Jason Evans2016-05-132-7/+7
|
* Guard tsdn_tsd() call with tsdn_null() check.Jason Evans2016-05-111-2/+2
|
* Mangle tested functions as n_witness_* rather than witness_*_impl.Jason Evans2016-05-111-9/+8
|
* Optimize witness fast path.Jason Evans2016-05-111-118/+4
| | | | | | | | | | | Short-circuit commonly called witness functions so that they only execute in debug builds, and remove equivalent guards from mutex functions. This avoids pointless code execution in witness_assert_lockless(), which is typically called twice per allocation/deallocation function invocation. Inline commonly called witness functions so that optimized builds can completely remove calls as dead code.
* Fix chunk accounting related to triggering gdump profiles.Jason Evans2016-05-111-0/+15
| | | | | Fix in place huge reallocation to update the chunk counters that are used for triggering gdump profiles.
* Resolve bootstrapping issues when embedded in FreeBSD libc.Jason Evans2016-05-1114-1196/+1257
| | | | | | | | | | | | | b2c0d6322d2307458ae2b28545f8a5c9903d7ef5 (Add witness, a simple online locking validator.) caused a broad propagation of tsd throughout the internal API, but tsd_fetch() was designed to fail prior to tsd bootstrapping. Fix this by splitting tsd_t into non-nullable tsd_t and nullable tsdn_t, and modifying all internal APIs that do not critically rely on tsd to take nullable pointers. Furthermore, add the tsd_booted_get() function so that tsdn_fetch() can probe whether tsd bootstrapping is complete and return NULL if not. All dangerous conversions of nullable pointers are tsdn_tsd() calls that assert-fail on invalid conversion.
* Fix tsd bootstrapping for a0malloc().Jason Evans2016-05-071-27/+31
|
* Optimize the fast paths of calloc() and [m,d,sd]allocx().Jason Evans2016-05-063-188/+116
| | | | | | | | This is a broader application of optimizations to malloc() and free() in f4a0f32d340985de477bbe329ecdaecd69ed1055 (Fast-path improvement: reduce # of branches and unnecessary operations.). This resolves #321.
* Modify pages_map() to support mapping uncommitted virtual memory.Jason Evans2016-05-063-25/+102
| | | | | | | | | | | If the OS overcommits: - Commit all mappings in pages_map() regardless of whether the caller requested committed memory. - Linux-specific: Specify MAP_NORESERVE to avoid unfortunate interactions with heuristic overcommit mode during fork(2). This resolves #193.
* Scale leak report summary according to sampling probability.Jason Evans2016-05-041-18/+38
| | | | | | | This makes the numbers reported in the leak report summary closely match those reported by jeprof. This resolves #356.
* Add the stats.retained and stats.arenas.<i>.retained statistics.Jason Evans2016-05-044-6/+30
| | | | This resolves #367.
* Fix huge_palloc() regression.Jason Evans2016-05-046-14/+15
| | | | | | | | | | Split arena_choose() into arena_[i]choose() and use arena_ichoose() for arena lookup during internal allocation. This fixes huge_palloc() so that it always succeeds during extent node allocation. This regression was introduced by 66cd953514a18477eb49732e40d5c2ab5f1b12c5 (Do not allocate metadata via non-auto arenas, nor tcaches.).
* Fix witness/fork() interactions.Jason Evans2016-04-262-4/+16
| | | | | | Fix witness to clear its list of owned mutexes in the child if platform-specific malloc_mutex code re-initializes mutexes rather than unlocking them.
* Fix fork()-related lock rank ordering reversals.Jason Evans2016-04-264-35/+123
|
* Fix arena reset effects on large/huge stats.Jason Evans2016-04-251-5/+24
| | | | | | Reset large curruns to 0 during arena reset. Do not increase huge ndalloc stats during arena reset.
* Fix arena_choose_hard() regression.Jason Evans2016-04-231-1/+1
| | | | | This regression was caused by 66cd953514a18477eb49732e40d5c2ab5f1b12c5 (Do not allocate metadata via non-auto arenas, nor tcaches.).
* Implement the arena.<i>.reset mallctl.Jason Evans2016-04-222-37/+224
| | | | | | | This makes it possible to discard all of an arena's allocations in a single operation. This resolves #146.
* Do not allocate metadata via non-auto arenas, nor tcaches.Jason Evans2016-04-228-112/+145
| | | | | This assures that all internally allocated metadata come from the first opt_narenas arenas, i.e. the automatically multiplexed arenas.
* Reduce a variable scope.Jason Evans2016-04-221-2/+1
|
* Update private_symbols.txt.Jason Evans2016-04-182-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Change test-related mangling to simplify symbol filtering. The following commands can be used to detect missing/obsolete symbol mangling, with the caveat that the full set of symbols is based on the union of symbols generated by all configurations, some of which are platform-specific: ./autogen.sh --enable-debug --enable-prof --enable-lazy-lock make all tests nm -a lib/libjemalloc.a src/*.jet.o \ |grep " [TDBCR] " \ |awk '{print $3}' \ |sed -e 's/^\(je_\|jet_\(n_\)\?\)\([a-zA-Z0-9_]*\)/\3/g' \ |LC_COLLATE=C sort -u \ |grep -v \ -e '^\(malloc\|calloc\|posix_memalign\|aligned_alloc\|realloc\|free\)$' \ -e '^\(m\|r\|x\|s\|d\|sd\|n\)allocx$' \ -e '^mallctl\(\|nametomib\|bymib\)$' \ -e '^malloc_\(stats_print\|usable_size\|message\)$' \ -e '^\(memalign\|valloc\)$' \ -e '^__\(malloc\|memalign\|realloc\|free\)_hook$' \ -e '^pthread_create$' \ > /tmp/private_symbols.txt
* Fix style nits.Jason Evans2016-04-171-1/+1
|
* Fix malloc_mutex_[un]lock() to conditionally check witness.Jason Evans2016-04-171-10/+0
| | | | Also remove tautological cassert(config_debug) calls.
* Convert base_mtx locking protocol comments to assertions.Jason Evans2016-04-171-10/+12
|
* Add witness, a simple online locking validator.Jason Evans2016-04-1414-1083/+1452
| | | | This resolves #358.
* Fix 64-to-32 conversion warnings in 32-bit moderustyx2016-04-121-11/+15
|
* 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.).