summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Add witness_assert_depth[_to_rank]().Jason Evans2017-02-021-12/+39
| | | | | This makes it possible to make lock state assertions about precisely which locks are held.
* Silence harmless warnings discovered via run_tests.sh.Jason Evans2017-02-011-2/+5
|
* Replace tabs following #define with spaces.Jason Evans2017-01-2147-249/+249
| | | | This resolves #564.
* Remove extraneous parens around return arguments.Jason Evans2017-01-2163-241/+241
| | | | This resolves #540.
* Update brace style.Jason Evans2017-01-2169-1062/+717
| | | | | | | Add braces around single-line blocks, and remove line breaks before function-opening braces. This resolves #537.
* Fix --disable-stats support.Jason Evans2017-01-201-12/+20
| | | | | Fix numerous regressions that were exposed by --disable-stats, both in the core library and in the tests.
* Test JSON output of malloc_stats_print() and fix bugs.Jason Evans2017-01-191-0/+1006
| | | | | | | | Implement and test a JSON validation parser. Use the parser to validate JSON output from malloc_stats_print(), with a significant subset of supported output options. This resolves #551.
* Fix prof_realloc() regression.Jason Evans2017-01-171-0/+57
| | | | | | | | | | | | | | Mostly revert the prof_realloc() changes in 498856f44a30b31fe713a18eb2fc7c6ecf3a9f63 (Move slabs out of chunks.) so that prof_free_sampled_object() is called when appropriate. Leave the prof_tctx_[re]set() optimization in place, but add an assertion to verify that all eight cases are correctly handled. Add a comment to make clear the code ordering, so that the regression originally fixed by ea8d97b8978a0c0423f0ed64332463a25b787c3d (Fix prof_{malloc,free}_sample_object() call order in prof_realloc().) is not repeated. This resolves #499.
* Add nullptr support to sized delete operators.Jason Evans2017-01-171-0/+10
|
* Remove leading blank lines from function bodies.Jason Evans2017-01-1362-154/+0
| | | | This resolves #535.
* Break up headers into constituent partsDavid Goldblatt2017-01-121-10/+6
| | | | | | | | | | This is part of a broader change to make header files better represent the dependencies between one another (see https://github.com/jemalloc/jemalloc/issues/533). It breaks up component headers into smaller parts that can be made to have a simpler dependency graph. For the autogenerated headers (smoothstep.h and size_classes.h), no splitting was necessary, so I didn't add support to emit multiple headers.
* Implement arena.<i>.destroy .Jason Evans2017-01-073-29/+240
| | | | | | | Add MALLCTL_ARENAS_DESTROYED for accessing destroyed arena stats as an analogue to MALLCTL_ARENAS_ALL. This resolves #382.
* Refactor test extent hook code to be reusable.Jason Evans2017-01-073-348/+366
| | | | | | Move test extent hook code from the extent integration test into a header, and normalize the out-of-band controls and introspection. Also refactor the base unit test to use the header.
* Replace the arenas.initialized mallctl with arena.<i>.initialized .Jason Evans2017-01-071-18/+31
|
* Rename the arenas.extend mallctl to arenas.create.Jason Evans2017-01-076-13/+13
|
* Add MALLCTL_ARENAS_ALL.Jason Evans2017-01-071-0/+8
| | | | | | | Add the MALLCTL_ARENAS_ALL cpp macro as a fixed index for use in accessing the arena.<i>.{purge,decay,dss} and stats.arenas.<i>.* mallctls, and deprecate access via the arenas.narenas index (to be removed in 6.0.0).
* Implement per arena base allocators.Jason Evans2016-12-272-46/+343
| | | | | | | | | | | | | Add/rename related mallctls: - Add stats.arenas.<i>.base . - Rename stats.arenas.<i>.metadata to stats.arenas.<i>.internal . - Add stats.arenas.<i>.resident . Modify the arenas.extend mallctl to take an optional (extent_hooks_t *) argument so that it is possible for all base allocations to be serviced by the specified extent hooks. This resolves #463.
* Refactor purging and splitting/merging.Jason Evans2016-12-271-16/+47
| | | | | | | | | | | | | | Split purging into lazy and forced variants. Use the forced variant for zeroing dss. Add support for NULL function pointers as an opt-out mechanism for the dalloc, commit, decommit, purge_lazy, purge_forced, split, and merge fields of extent_hooks_t. Add short-circuiting checks in large_ralloc_no_move_{shrink,expand}() so that no attempt is made if splitting/merging is not supported. This resolves #268.
* Add huge page configuration and pages_[no}huge().Jason Evans2016-12-271-0/+30
| | | | | | | | Add the --with-lg-hugepage configure option, but automatically configure LG_HUGEPAGE even if it isn't specified. Add the pages_[no]huge() functions, which toggle huge page state via madvise(..., MADV_[NO]HUGEPAGE) calls.
* Simplify arena_slab_regind().Jason Evans2016-12-231-0/+35
| | | | | | | | | Rewrite arena_slab_regind() to provide sufficient constant data for the compiler to perform division strength reduction. This replaces more general manual strength reduction that was implemented before arena_bin_info was compile-time-constant. It would be possible to slightly improve on the compiler-generated division code by taking advantage of range limits that the compiler doesn't know about.
* jemalloc cpp new/delete bindingsDave Watson2016-12-133-3/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds cpp bindings for jemalloc, along with necessary autoconf settings. This is mostly to add sized deallocation support, which can't be added from C directly. Sized deallocation is ~10% microbench improvement. * Import ax_cxx_compile_stdcxx.m4 from the autoconf repo, seems like the easiest way to get c++14 detection. * Adds various other changes, like CXXFLAGS, to configure.ac. * Adds new rules to Makefile.in for src/jemalloc-cpp.cpp, and a basic unittest. * Both new and delete are overridden, to ensure jemalloc is used for both. * TODO future enhancement of avoiding extra PLT thunks for new and delete - sdallocx and malloc are publicly exported jemalloc symbols, using an alias would link them directly. Unfortunately, was having trouble getting it to play nice with jemalloc's namespace support. Testing: Tested gcc 4.8, gcc 5, gcc 5.2, clang 4.0. Only gcc >= 5 has sized deallocation support, verified that the rest build correctly. Tested mac osx and Centos. Tested --with-jemalloc-prefix and --without-export. This resolves #202.
* Add a_type parameter to qr_{meld,split}().Jason Evans2016-12-131-6/+6
|
* Uniformly cast mallctl[bymib]() oldp/newp arguments to (void *).Jason Evans2016-11-151-6/+6
| | | | | This avoids warnings in some cases, and is otherwise generally good hygiene.
* Add packing test, which verifies stable layout policy.Jason Evans2016-11-151-0/+167
|
* Reduce memory usage for sdallocx() test_alignment_and_size.Jason Evans2016-11-121-2/+2
|
* Fix test_prng_lg_range_zu() to work on 32-bit systems.Jason Evans2016-11-071-10/+10
|
* Rename atomic_*_{uint32,uint64,u}() to atomic_*_{u32,u64,zu}().Jason Evans2016-11-071-12/+12
| | | | This change conforms to naming conventions throughout the codebase.
* Refactor prng to not use 64-bit atomics on 32-bit platforms.Jason Evans2016-11-071-22/+187
| | | | This resolves #495.
* Fix psz/pind edge cases.Jason Evans2016-11-041-15/+17
| | | | | | | | | Add an "over-size" extent heap in which to store extents which exceed the maximum size class (plus cache-oblivious padding, if enabled). Remove psz2ind_clamp() and use psz2ind() instead so that trying to allocate the maximum size class can in principle succeed. In practice, this allows assertions to hold so that OOM errors can be successfully generated.
* Fix long spinning in rtree_node_initDave Watson2016-11-031-0/+2
| | | | | | | | | | | | | | | | | rtree_node_init spinlocks the node, allocates, and then sets the node. This is under heavy contention at the top of the tree if many threads start to allocate at the same time. Instead, take a per-rtree sleeping mutex to reduce spinning. Tested both pthreads and osx OSSpinLock, and both reduce spinning adequately Previous benchmark time: ./ttest1 500 100 ~15s New benchmark time: ./ttest1 500 100 .57s
* Add os_unfair_lock support.Jason Evans2016-11-032-0/+9
| | | | | OS X 10.12 deprecated OSSpinLock; os_unfair_lock is the recommended replacement.
* Call _exit(2) rather than exit(3) in forked child.Jason Evans2016-11-031-1/+1
| | | | _exit(2) is async-signal-safe, whereas exit(3) is not.
* Reduce memory requirements for regression tests.Jason Evans2016-10-283-35/+55
| | | | | | | This is intended to drop memory usage to a level that AppVeyor test instances can handle. This resolves #393.
* Periodically purge in memory-intensive integration tests.Jason Evans2016-10-281-0/+7
| | | | This resolves #393.
* Periodically purge in memory-intensive integration tests.Jason Evans2016-10-283-6/+27
| | | | This resolves #393.
* Uniformly cast mallctl[bymib]() oldp/newp arguments to (void *).Jason Evans2016-10-2821-293/+326
| | | | | This avoids warnings in some cases, and is otherwise generally good hygiene.
* Explicitly cast negative constants meant for use as unsigned.Jason Evans2016-10-281-3/+5
|
* Add cast to silence (harmless) conversion warning.Jason Evans2016-10-281-1/+1
|
* Do not (recursively) allocate within tsd_fetch().Jason Evans2016-10-212-24/+24
| | | | | | | Refactor tsd so that tsdn_fetch() does not trigger allocation, since allocation could cause infinite recursion. This resolves #458.
* Make dss operations lockless.Jason Evans2016-10-131-2/+2
| | | | | | | | | | | | | | Rather than protecting dss operations with a mutex, use atomic operations. This has negligible impact on synchronization overhead during typical dss allocation, but is a substantial improvement for extent_in_dss() and the newly added extent_dss_mergeable(), which can be called multiple times during extent deallocations. This change also has the advantage of avoiding tsd in deallocation paths associated with purging, which resolves potential deadlocks during thread exit due to attempted tsd resurrection. This resolves #425.
* Remove all vestiges of chunks.Jason Evans2016-10-126-43/+11
| | | | | | | | Remove mallctls: - opt.lg_chunk - stats.cactive This resolves #464.
* Remove ratio-based purging.Jason Evans2016-10-122-84/+1
| | | | | | | | | | | | | Make decay-based purging the default (and only) mode. Remove associated mallctls: - opt.purge - opt.lg_dirty_mult - arena.<i>.lg_dirty_mult - arenas.lg_dirty_mult - stats.arenas.<i>.lg_dirty_mult This resolves #385.
* Fix decay tests to all adapt to nstime_monotonic().Jason Evans2016-10-111-6/+9
|
* Do not advance decay epoch when time goes backwards.Jason Evans2016-10-112-2/+20
| | | | | | Instead, move the epoch backward in time. Additionally, add nstime_monotonic() and use it in debug builds to assert that time only goes backward if nstime_update() is using a non-monotonic time source.
* Verify extent hook functions receive correct extent_hooks pointer.Jason Evans2016-09-291-17/+52
|
* Work around a weird pgi bug in test/unit/math.cElliot Ronaghan2016-06-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | pgi fails to compile math.c, reporting that `-INFINITY` in `pt_norm_expected[]` is a "Non-constant" expression. A simplified version of this failure is: ```c #include <math.h> static double inf1, inf2 = INFINITY; // no complaints static double inf3 = INFINITY; // suddenly INFINITY is "Non-constant" int main() { } ``` ```sh PGC-S-0074-Non-constant expression in initializer (t.c: 4) ``` pgi errors on the declaration of inf3, and will compile fine if that line is removed. I've reported this bug to pgi, but in the meantime I just switched to using (DBL_MAX + DBL_MAX) to work around this bug.
* Relax extent hook tests to work with unsplittable extents.Jason Evans2016-06-061-8/+19
|
* Fix regressions related extent splitting failures.Jason Evans2016-06-061-3/+5
| | | | | | | | | | Fix a fundamental extent_split_wrapper() bug in an error path. Fix extent_recycle() to deregister unsplittable extents before leaking them. Relax xallocx() test assertions so that unsplittable extents don't cause test failures.
* Work around legitimate xallocx() failures during testing.Jason Evans2016-06-061-6/+12
| | | | | | | | | | With the removal of subchunk size class infrastructure, there are no large size classes that are guaranteed to be re-expandable in place unless munmap() is disabled. Work around these legitimate failures with rallocx() fallback calls. If there were no test configuration for which the xallocx() calls succeeded, it would be important to override the extent hooks for testing purposes, but by default these tests don't use the rallocx() fallbacks on Linux, so test coverage is still sufficient.
* Remove a stray memset(), and fix a junk filling test regression.Jason Evans2016-06-061-5/+19
|