summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Convert ALLOCM_ARENA() test to MALLOCX_ARENA() test.Jason Evans2014-03-282-5/+5
| | |
| * | Merge pull request #60 from telemenar/devJason Evans2014-03-281-1/+4
| |\ \ | | |/ | |/| Fix a crashing case where arena_chunk_init_hard returns NULL.
| | * Fix a crashing case where arena_chunk_init_hard returns NULL.Chris Pride2014-03-261-1/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | This happens when it fails to allocate a new chunk. Which arena_chunk_alloc then passes into arena_avail_insert without any checks. This then causes a crash when arena_avail_insert tries to check chunk->ndirty. This was introduced by the refactoring of arena_chunk_alloc which previously would have returned NULL immediately after calling chunk_alloc. This is now the return from arena_chunk_init_hard so we need to check that return, and not continue if it was NULL.
| * Remove duplicate 'static' keyword.Jason Evans2014-02-261-1/+1
|/ | | | Reported by İsmail Dönmez.
* Merge branch 'dev'3.5.1Jason Evans2014-02-2618-116/+140
|\
| * Update ChangeLog for 3.5.1.Jason Evans2014-02-261-2/+20
| |
| * Restore tail call optimization subversion.Jason Evans2014-02-261-7/+13
| | | | | | | | | | | | Restore the essence of 898960247a8b2e6534738b7a3a244855f379faf9, which sabotages tail call optimization. This is necessary even when the mutually recursive functions are in separate compilation units.
| * Fix junk filling for mremap(2)-based huge reallocation.Jason Evans2014-02-252-3/+16
| | | | | | | | | | | | | | If mremap(2) is used for huge reallocation, physical pages are mapped to new virtual addresses rather than data being copied to new pages. This bypasses the normal junk filling that would happen during allocation, so add junk filling that is specific to this case.
| * Add configure test to verify SSE2 code compiles.Jason Evans2014-02-251-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure that emmintrin.h can be #include'd without causing a compilation error, rather than blindly defining HAVE_SSE2 based on architecture. Attempts to force SSE2 compilation on a 32-bit Ubuntu 13.10 system running as a VMware guest resulted in a no-win choice without any obvious explanation besides toolchain misconfiguration/bug: - Suffer compilation failure due to __MMX__, __SSE__, and __SSE2__ not being defined, even if -mmmx, -msse, and -msse2 are manually specified (note that they appear to be enabled by default). - Manually define __MMX__, __SSE__, and __SSE2__, and suffer compiler warnings that they are already automatically defined. This results in successful compilation and execution, but the noise is intolerable.
| * Break prof_accum into multiple compilation units.Jason Evans2014-02-255-40/+48
| | | | | | | | | | | | Break prof_accum into multiple compilation units, in order to thwart compiler optimizations such as inlining and tail call optimization that would alter backtraces.
| * Add workaround for missing 'restrict' keyword.Jason Evans2014-02-253-0/+12
| | | | | | | | | | | | | | | | | | Add a cpp #define that removes 'restrict' keyword usage unless the compiler definitely supports C99. As written, 'restrict' is only enabled if the compiler supports the -std=gnu99 option (e.g. gcc and llvm). Reported by Tobias Hieta.
| * Merge pull request #51 from ErwanLegrand/devJason Evans2014-02-141-1/+0
| |\ | | | | | | Fix typo
| | * Fix typoErwan Legrand2014-02-141-1/+0
| |/
| * Merge pull request #50 from georgekola/Voxer-SolarisJason Evans2014-02-131-0/+1
| |\ | | | | | | Using MADV_FREE on Solaris/Illumos
| | * Using MADV_FREE on Solaris/IllumosGeorge Kola2014-02-121-0/+1
| |/
| * Prevent inlining of backtraced test functions.Jason Evans2014-01-291-2/+2
| | | | | | | | | | Inlining of alloc_0() and alloc_1() would prevent generation of unique backtraces, upon which the test code relies.
| * Remove flawed alignment-related overflow test.Jason Evans2014-01-291-23/+0
| | | | | | | | | | | | | | | | Remove the allocm() test equivalent to the mallocx() test removed in the previous commit. The flawed test attempted to cause OOM due to large request size and alignment constraint. Although this test "passed" on 64-bit systems due to the virtual memory hole, it could pass on some 32-bit systems.
| * Avoid a compiler warning.Jason Evans2014-01-291-1/+5
| | | | | | | | | | | | | | | | Avoid copying "jeprof" to a 1-byte buffer within prof_boot0() when heap profiling is disabled. Although this is dead code under such conditions, the compiler doesn't figure that part out. Reported by Eduardo Silva.
| * Fix/remove flawed alignment-related overflow tests.Jason Evans2014-01-293-25/+4
| | | | | | | | | | | | | | 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.
| * Fix mallctl argument size mismatches (size_t vs. uint64_t).Jason Evans2014-01-291-8/+15
| | | | | | | | Reported by İsmail Dönmez.
| * Fix a typo.Jason Evans2014-01-221-1/+1
|/
* Merge branch 'dev'3.5.0Jason Evans2014-01-22136-3802/+13957
|\
| * Update ChangeLog for 3.5.0.Jason Evans2014-01-221-1/+1
| |
| * Update copyrights.Jason Evans2014-01-221-2/+2
| |
| * Test and fix malloc_printf("%%").Jason Evans2014-01-222-7/+8
| |
| * Remove __FBSDID from rb.h.Jason Evans2014-01-221-4/+0
| |
| * Subvert tail call optimization in backtrace test.Jason Evans2014-01-211-11/+17
| | | | | | | | | | | | | | Re-structure alloc_[01](), which are mutually tail-recursive functions, to do (unnecessary) work post-recursion so that the compiler cannot perform tail call optimization, thus preserving intentionally unique call paths in captured backtraces.
| * Fix unused variable warnings.Jason Evans2014-01-212-7/+3
| |
| * Avoid lazy-lock in a tcache-dependent test.Jason Evans2014-01-211-14/+34
| |
| * Update ChangeLog.Jason Evans2014-01-181-0/+38
| |
| * Add heap profiling tests.Jason Evans2014-01-177-22/+290
| | | | | | | | | | | | Fix a regression in prof_dump_ctx() due to an uninitized variable. This was caused by revision 4f37ef693e3d5903ce07dc0b61c0da320b35e3d9, so no releases are affected.
| * Fix a variable prototype/definition mismatch.Jason Evans2014-01-172-3/+7
| |
| * Fix name mangling for stress tests.Jason Evans2014-01-1713-174/+164
| | | | | | | | | | | | | | | | | | | | | | Fix stress tests such that testlib code uses the jet_ allocator, but test code uses libjemalloc. Generate jemalloc_{rename,mangle}.h, the former because it's needed for the stress test name mangling fix, and the latter for consistency. As an artifact of this change, some (but not all) definitions related to the experimental API are absent from the headers unless the feature is enabled at configure time.
| * Refactor prof_dump() to reduce contention.Jason Evans2014-01-162-172/+278
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor prof_dump() to use a two pass algorithm, and prof_leave() prior to the second pass. This avoids write(2) system calls while holding critical prof resources. Fix prof_dump() to close the dump file descriptor for all relevant error paths. Minimize the size of prof-related static buffers when prof is disabled. This saves roughly 65 KiB of application memory for non-prof builds. Refactor prof_ctx_init() out of prof_lookup_global().
| * Fix warnings and a test failure exposed on CentOS 6.3.Jason Evans2014-01-152-4/+5
| |
| * Refactor prof_lookup() by extracting prof_lookup_global().Jason Evans2014-01-151-82/+79
| |
| * Refactor overly large/complex functions.Jason Evans2014-01-152-383/+462
| | | | | | | | | | | | | | Refactor overly large functions by breaking out helper functions. Refactor overly complex multi-purpose functions into separate more specific functions.
| * Extract profiling code from [re]allocation functions.Jason Evans2014-01-1210-496/+552
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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().
| * Add junk/zero filling unit tests, and fix discovered bugs.Jason Evans2014-01-089-31/+420
| | | | | | | | | | | | Fix growing large reallocation to junk fill new space. Fix huge deallocation to junk fill when munmap is disabled.
| * Add util unit tests, and fix discovered bugs.Jason Evans2014-01-075-30/+416
| | | | | | | | | | | | | | | | | | | | | | | | | | Add unit tests for pow2_ceil(), malloc_strtoumax(), and malloc_snprintf(). Fix numerous bugs in malloc_strotumax() error handling/reporting. These bugs could have caused application-visible issues for some seldom used (0X... and 0... prefixes) or malformed MALLOC_CONF or mallctl() argument strings, but otherwise they had no impact. Fix numerous bugs in malloc_snprintf(). These bugs were not exercised by existing malloc_*printf() calls, so they had no impact.
| * Convert assert() in test code to assert_*().Jason Evans2014-01-041-4/+12
| |
| * Add unit tests for qr, ql, and rb.Jason Evans2014-01-044-3/+789
| |
| * Convert rtree from (void *) to (uint8_t) storage.Jason Evans2014-01-035-55/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | Reduce rtree memory usage by storing booleans (1 byte each) rather than pointers. The rtree code is only used to record whether jemalloc manages a chunk of memory, so there's no need to store pointers in the rtree. Increase rtree node size to 64 KiB in order to reduce tree depth from 13 to 3 on 64-bit systems. The conversion to more compact leaf nodes was enough by itself to make the rtree depth 1 on 32-bit systems; due to the fact that root nodes are smaller than the specified node size if possible, the node size change has no impact on 32-bit systems (assuming default chunk size).
| * Add rtree unit tests.Jason Evans2014-01-036-10/+165
| |
| * Clean up code formatting.Jason Evans2014-01-021-4/+2
| |
| * Fix an uninitialized variable read in xallocx().Jason Evans2013-12-201-0/+3
| |
| * Add stats unit tests.Jason Evans2013-12-202-1/+352
| |
| * Fix a few mallctl() documentation errors.Jason Evans2013-12-202-138/+144
| | | | | | | | Normalize mallctl() order (code and documentation).
| * Add mallctl*() unit tests.Jason Evans2013-12-204-15/+435
| |
| * Remove ENOMEM from the documented set of *mallctl() errors.Jason Evans2013-12-181-6/+0
| | | | | | | | | | | | | | *mallctl() always returns EINVAL and does partial result copying when *oldlenp is to short to hold the requested value, rather than returning ENOMEM. Therefore remove ENOMEM from the documented set of possible errors.