summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Modify extent hook functions to take an (extent_t *) argument.Jason Evans2016-06-061-67/+84
| | | | | | | This facilitates the application accessing its own extent allocator metadata during hook invocations. This resolves #259.
* Add rtree lookup path caching.Jason Evans2016-06-061-35/+48
| | | | | | | | | rtree-based extent lookups remain more expensive than chunk-based run lookups, but with this optimization the fast path slowdown is ~3 CPU cycles per metadata lookup (on Intel Core i7-4980HQ), versus ~11 cycles prior. The path caching speedup tends to degrade gracefully unless allocated memory is spread far apart (as is the case when using a mixture of sbrk() and mmap()).
* Reduce NSZS, since NSIZES (was nsizes) can not be so large.Jason Evans2016-06-061-1/+1
|
* Miscellaneous s/chunk/extent/ updates.Jason Evans2016-06-063-5/+3
|
* Rename most remaining *chunk* APIs to *extent*.Jason Evans2016-06-061-41/+41
|
* s/chunk_lookup/extent_lookup/g, s/chunks_rtree/extents_rtree/gJason Evans2016-06-061-1/+1
|
* s/chunk_hook/extent_hook/gJason Evans2016-06-061-11/+11
|
* Rename huge to large.Jason Evans2016-06-0613-171/+171
|
* Move slabs out of chunks.Jason Evans2016-06-063-15/+16
|
* Use huge size class infrastructure for large size classes.Jason Evans2016-06-0611-559/+79
|
* Implement cache-oblivious support for huge size classes.Jason Evans2016-06-031-12/+42
|
* Allow chunks to not be naturally aligned.Jason Evans2016-06-031-16/+0
| | | | | Precisely size extents for huge size classes that aren't multiples of chunksize.
* Replace extent_tree_szad_* with extent_heap_*.Jason Evans2016-06-031-0/+155
|
* Dodge ivsalloc() assertion in test code.Jason Evans2016-06-031-1/+16
|
* Add rtree element witnesses.Jason Evans2016-06-032-19/+25
|
* Refactor rtree to always use base_alloc() for node allocation.Jason Evans2016-06-031-35/+82
|
* Add element acquire/release capabilities to rtree.Jason Evans2016-06-031-34/+119
| | | | | | | | 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-161-12/+13
|
* Refactor runs_avail.Jason Evans2016-05-161-1/+1
| | | | | | | | 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-131-11/+83
| | | | | | | 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-131-1/+1
| | | | This resolves #370.
* Implement BITMAP_INFO_INITIALIZER(nbits).Jason Evans2016-05-131-109/+296
| | | | This allows static initialization of bitmap_info_t structures.
* Remove redzone support.Jason Evans2016-05-133-48/+3
| | | | This resolves #369.
* Remove quarantine support.Jason Evans2016-05-135-113/+2
|
* Remove Valgrind support.Jason Evans2016-05-132-3/+1
|
* Disable junk filling for tests that could otherwise easily OOM.Jason Evans2016-05-112-0/+8
|
* Resolve bootstrapping issues when embedded in FreeBSD libc.Jason Evans2016-05-115-88/+88
| | | | | | | | | | | | | 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-075-16/+69
|
* Don't test fork() on Windows.Jason Evans2016-05-041-0/+6
|
* Update mallocx() OOM test to deal with smaller hugemax.Jason Evans2016-05-031-10/+19
| | | | | | | | | | | | | 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.
* Fix witness/fork() interactions.Jason Evans2016-04-261-3/+22
| | | | | | 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-261-0/+39
|
* Use separate arena for chunk tests.Jason Evans2016-04-261-28/+45
| | | | | This assures that side effects of internal allocation don't impact tests.
* Fix arena_reset() test to avoid tcache.Jason Evans2016-04-251-10/+9
|
* Implement the arena.<i>.reset mallctl.Jason Evans2016-04-221-0/+160
| | | | | | | This makes it possible to discard all of an arena's allocations in a single operation. This resolves #146.
* Fix style nits.Jason Evans2016-04-173-4/+4
|