summaryrefslogtreecommitdiffstats
path: root/test/integration/mallocx.c
Commit message (Collapse)AuthorAgeFilesLines
* Use MALLOC_CONF rather than malloc_conf for tests.Jason Evans2017-02-231-4/+0
| | | | | | | | | malloc_conf does not reliably work with MSVC, which complains of "inconsistent dll linkage", i.e. its inability to support the application overriding malloc_conf when dynamically linking/loading. Work around this limitation by adding test harness support for per test shell script sourcing, and converting all tests to use MALLOC_CONF instead of malloc_conf.
* Replace tabs following #define with spaces.Jason Evans2017-01-211-3/+3
| | | | This resolves #564.
* Remove extraneous parens around return arguments.Jason Evans2017-01-211-6/+6
| | | | This resolves #540.
* Update brace style.Jason Evans2017-01-211-24/+18
| | | | | | | Add braces around single-line blocks, and remove line breaks before function-opening braces. This resolves #537.
* Remove leading blank lines from function bodies.Jason Evans2017-01-131-4/+0
| | | | This resolves #535.
* Reduce memory requirements for regression tests.Jason Evans2016-10-281-19/+25
| | | | | | | 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-281-0/+7
| | | | This resolves #393.
* Uniformly cast mallctl[bymib]() oldp/newp arguments to (void *).Jason Evans2016-10-281-2/+2
| | | | | This avoids warnings in some cases, and is otherwise generally good hygiene.
* Rename huge to large.Jason Evans2016-06-061-12/+12
|
* Disable junk filling for tests that could otherwise easily OOM.Jason Evans2016-05-111-0/+4
|
* 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.
* Add (size_t) casts to MALLOCX_ALIGN().Jason Evans2016-03-111-13/+10
| | | | | | | | 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.
* Remove invalid tests.Jason Evans2016-02-271-9/+1
| | | | | Remove invalid tests that were intended to be tests of (hugemax+1) OOM, for which tests already exist.
* Cast PTRDIFF_MAX to size_t before adding 1.Jason Evans2016-02-261-4/+4
| | | | | | 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-251-0/+30
| | | | | | | 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.
* Make mallocx() OOM test more robust.Jason Evans2015-09-241-3/+14
| | | | | | Make mallocx() OOM testing work correctly even on systems that can allocate the majority of virtual address space in a single contiguous region.
* Add mallocx() OOM tests.Jason Evans2015-09-171-0/+70
|
* Fix size class overflow handling when profiling is enabled.Jason Evans2015-06-241-5/+6
| | | | | | | | | | Fix size class overflow handling for malloc(), posix_memalign(), memalign(), calloc(), and realloc() when profiling is enabled. Remove an assertion that erroneously caused arena_sdalloc() to fail when profiling was enabled. This resolves #232.
* Remove obsolete (incorrect) assertions.Jason Evans2015-02-161-21/+24
| | | | | | | This regression was introduced by 88fef7ceda6269598cef0cee8b984c8765673c27 (Refactor huge_*() calls into arena internals.), and went undetected because of the --enable-debug regression.
* Reduce maximum tested alignment.Jason Evans2014-03-301-2/+1
| | | | | | | Reduce maximum tested alignment from 2^29 to 2^25. Some systems may not have enough contiguous virtual memory to satisfy the larger alignment, but the smaller alignment is still adequate to test multi-chunk alignment.
* Fix/remove flawed alignment-related overflow tests.Jason Evans2014-01-291-21/+0
| | | | | | | Fix/remove three related flawed tests that attempted to cause OOM due to large request size and alignment constraint. Although these tests "passed" on 64-bit systems due to the virtual memory hole, they could pass on some 32-bit systems.
* Extract profiling code from [re]allocation functions.Jason Evans2014-01-121-30/+0
| | | | | | | | | | | | | | | | | | | Extract profiling code from malloc(), imemalign(), calloc(), realloc(), mallocx(), rallocx(), and xallocx(). This slightly reduces the amount of code compiled into the fast paths, but the primary benefit is the combinatorial complexity reduction. Simplify iralloc[t]() by creating a separate ixalloc() that handles the no-move cases. Further simplify [mrxn]allocx() (and by implication [mrn]allocm()) to make request size overflows due to size class and/or alignment constraints trigger undefined behavior (detected by debug-only assertions). Report ENOMEM rather than EINVAL if an OOM occurs during heap profiling backtrace creation in imemalign(). This bug impacted posix_memalign() and aligned_alloc().
* Implement the *allocx() API.Jason Evans2013-12-131-0/+149
Implement the *allocx() API, which is a successor to the *allocm() API. The *allocx() functions are slightly simpler to use because they have fewer parameters, they directly return the results of primary interest, and mallocx()/rallocx() avoid the strict aliasing pitfall that allocm()/rallocx() share with posix_memalign(). The following code violates strict aliasing rules: foo_t *foo; allocm((void **)&foo, NULL, 42, 0); whereas the following is safe: foo_t *foo; void *p; allocm(&p, NULL, 42, 0); foo = (foo_t *)p; mallocx() does not have this problem: foo_t *foo = (foo_t *)mallocx(42, 0);