aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2016-12-12Update to jemalloc 4.4.0.Christopher Ferris
Merge remote-tracking branch 'aosp/upstream-new' into upgrade Includes regenerating the necessary files. Bug: 33321361 Test: Built for x86_64/arm64. Built the no tcache and tcache enabled Test: configs (nexus 9/nexus 6p). Compared the before after running Test: all dumps through the memory replay and verified no unexpected Test: increases. Ran bionic unit tests in both configs, 32 bit and 64 bit Test: variants. Ran the jemalloc unit tests in both configs. Change-Id: I2e8f3305cd1717c7efced69718fff90797f21068
2016-11-24Mark partially purged arena chunks as non-hugepage.Jason Evans
Add the pages_[no]huge() functions, which toggle huge page state via madvise(..., MADV_[NO]HUGEPAGE) calls. The first time a page run is purged from within an arena chunk, call pages_nohuge() to tell the kernel to make no further attempts to back the chunk with huge pages. Upon arena chunk deletion, restore the associated virtual memory to its original state via pages_huge(). This resolves #243.
2016-11-15Uniformly cast mallctl[bymib]() oldp/newp arguments to (void *).Jason Evans
This avoids warnings in some cases, and is otherwise generally good hygiene.
2016-11-15Explicitly cast negative constants meant for use as unsigned.Jason Evans
2016-11-15Add cast to silence (harmless) conversion warning.Jason Evans
2016-11-15Add packing test, which verifies stable layout policy.Jason Evans
2016-11-11Reduce memory usage for sdallocx() test_alignment_and_size.Jason Evans
2016-11-10Merge remote-tracking branch 'aosp/upstream-new' into fixChristopher Ferris
Included in this change are all of the updated generated files. Bug: 32673024 Test: Built the angler build (normal config) and the volantis build Test: (svelte config). Ran memory_replay 32 bit and 64 bit on both Test: platforms before and after and verified results are similar. Test: Ran bionic unit tests and jemalloc unit tests. Test: Verified that two jemalloc unit test failures are due to Test: Android extension that puts all large chunks on arena 0. Change-Id: I12428bdbe15f51383489c9a1d72d687499fff01b
2016-11-07Refactor prng to not use 64-bit atomics on 32-bit platforms.Jason Evans
This resolves #495.
2016-11-07Fix run leak.Jason Evans
Fix arena_run_first_best_fit() to search all potentially non-empty runs_avail heaps, rather than ignoring the heap that contains runs larger than large_maxclass, but less than chunksize. This fixes a regression caused by f193fd80cf1f99bce2bc9f5f4a8b149219965da2 (Refactor runs_avail.). This resolves #493.
2016-11-02Add os_unfair_lock support.Jason Evans
OS X 10.12 deprecated OSSpinLock; os_unfair_lock is the recommended replacement.
2016-11-02Call _exit(2) rather than exit(3) in forked child.Jason Evans
_exit(2) is async-signal-safe, whereas exit(3) is not.
2016-10-28Reduce memory requirements for regression tests.Jason Evans
This is intended to drop memory usage to a level that AppVeyor test instances can handle. This resolves #393.
2016-10-28Periodically purge in memory-intensive integration tests.Jason Evans
This resolves #393.
2016-10-28Periodically purge in memory-intensive integration tests.Jason Evans
This resolves #393.
2016-10-21Do not (recursively) allocate within tsd_fetch().Jason Evans
Refactor tsd so that tsdn_fetch() does not trigger allocation, since allocation could cause infinite recursion. This resolves #458.
2016-10-13Make dss operations lockless.Jason Evans
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 chunk_in_dss() and the newly added chunk_dss_mergeable(), which can be called multiple times during chunk 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.
2016-10-11Fix decay tests to all adapt to nstime_monotonic().Jason Evans
2016-10-10Do not advance decay epoch when time goes backwards.Jason Evans
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.
2016-10-04Refactor runs_avail.Jason Evans
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).
2016-10-04Implement pz2ind(), pind2sz(), and psz2u().Jason Evans
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.
2016-09-26Work around a weird pgi bug in test/unit/math.cElliot Ronaghan
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.
2016-06-14Updates to generated files for 4.2.1 release.android-wear-n-preview-2android-wear-7.1.1_r1android-n-preview-5android-n-iot-preview-2nougat-mr1-wear-releasen-iot-preview-2Christopher Ferris
Bug: 28860984 Change-Id: If12daed270ec0a85cd151aaaa432d178c8389757
2016-06-14Merge remote-tracking branch 'aosp/upstream-release' into fixChristopher Ferris
Bug: 28860984 Change-Id: I9eaf67f53f9872177d068d660d1e051cecdc82a0
2016-05-11Disable junk filling for tests that could otherwise easily OOM.Jason Evans
2016-05-10Resolve bootstrapping issues when embedded in FreeBSD libc.Jason Evans
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.
2016-05-07Fix tsd bootstrapping for a0malloc().Jason Evans
2016-05-03Don't test fork() on Windows.Jason Evans
2016-05-03Update mallocx() OOM test to deal with smaller hugemax.Jason Evans
Depending on virtual memory resource limits, it is necessary to attempt allocating three maximally sized objects to trigger OOM rather than just two, since the maximum supported size is slightly less than half the total virtual memory address space. This fixes a test failure that was introduced by 0c516a00c4cb28cff55ce0995f756b5aae074c9e (Make *allocx() size class overflow behavior defined.). This resolves #379.
2016-04-26Fix witness/fork() interactions.Jason Evans
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.
2016-04-25Fix fork()-related lock rank ordering reversals.Jason Evans
2016-04-25Use separate arena for chunk tests.Jason Evans
This assures that side effects of internal allocation don't impact tests.
2016-04-25Fix arena_reset() test to avoid tcache.Jason Evans
2016-04-22Implement the arena.<i>.reset mallctl.Jason Evans
This makes it possible to discard all of an arena's allocations in a single operation. This resolves #146.
2016-04-17Fix style nits.Jason Evans
2016-04-14Add witness, a simple online locking validator.Jason Evans
This resolves #358.
2016-04-12Fix more 64-to-32 conversion warnings.Jason Evans
2016-04-11Clean up char vs. uint8_t in junk filling code.Jason Evans
Consistently use uint8_t rather than char for junk filling code.
2016-04-11Refactor/fix ph.Jason Evans
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.
2016-04-05Fix a compilation warning in the ph test code.Jason Evans
2016-03-31Add JEMALLOC_ALLOC_JUNK and JEMALLOC_FREE_JUNK macrosChris Peterson
Replace hardcoded 0xa5 and 0x5a junk values with JEMALLOC_ALLOC_JUNK and JEMALLOC_FREE_JUNK macros, respectively.
2016-03-23Avoid blindly enabling assertions for header code when testing.Jason Evans
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.
2016-03-23Code formatting fixes.Jason Evans
2016-03-15Refactor out signed/unsigned comparisons.Jason Evans
2016-03-11Add (size_t) casts to MALLOCX_ALIGN().Jason Evans
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.
2016-03-08Unittest for pairing heapDave Watson
2016-03-05Update generated files for 4.1.0 update.Christopher Ferris
Removed the hack to do an always purge. Instead use the new decay purging mechanism, but set the decay timeout to 0 so it always purges without the need to change the code. Added back the a0get function to use for huge chunk allocation patch we use for android. Bug: 27408522 Change-Id: Ic75c4a03b362fd0f9654f0803fb9624ef82d417e
2016-03-03Merge remote-tracking branch 'aosp/upstream-dev' into mergeChristopher Ferris
Bug: 26807329 Change-Id: I25b32740420ffdfd62e32ddcd3fdc54a5010e4cf
2016-03-02Revert "Fix the ckh unit test."Christopher Ferris
This reverts commit 14d6af1aa29cffc323606f2c41c531f3b64f4072. Bug: 26807329 Change-Id: I4ebdf57229e3683781ea16b0801813c69414ce7b
2016-02-29Fix stack corruption and uninitialized var warningDmitri Smirnov
Stack corruption happens in x64 bit This resolves #347.