- Jan 22, 2014
-
-
Jason Evans authored
-
Jason Evans authored
-
Jason Evans authored
-
Jason Evans authored
-
- Jan 21, 2014
-
-
Jason Evans authored
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.
-
Jason Evans authored
-
Jason Evans authored
-
- Jan 18, 2014
-
-
Jason Evans authored
-
Jason Evans authored
Fix a regression in prof_dump_ctx() due to an uninitized variable. This was caused by revision 4f37ef69, so no releases are affected.
-
- Jan 17, 2014
-
-
Jason Evans authored
-
Jason Evans authored
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.
-
- Jan 16, 2014
-
-
Jason Evans authored
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().
-
- Jan 15, 2014
-
-
Jason Evans authored
-
Jason Evans authored
-
Jason Evans authored
Refactor overly large functions by breaking out helper functions. Refactor overly complex multi-purpose functions into separate more specific functions.
-
- Jan 13, 2014
-
-
Jason Evans authored
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().
-
- Jan 08, 2014
-
-
Jason Evans authored
Fix growing large reallocation to junk fill new space. Fix huge deallocation to junk fill when munmap is disabled.
-
- Jan 07, 2014
-
-
Jason Evans authored
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.
-
- Jan 04, 2014
-
-
Jason Evans authored
-
Jason Evans authored
-
- Jan 03, 2014
-
-
Jason Evans authored
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).
-
Jason Evans authored
-
- Jan 02, 2014
-
-
Jason Evans authored
-
- Dec 21, 2013
-
-
Jason Evans authored
-
Jason Evans authored
-
- Dec 20, 2013
-
-
Jason Evans authored
Normalize mallctl() order (code and documentation).
-
Jason Evans authored
-
- Dec 19, 2013
-
-
Jason Evans authored
*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.
-
- Dec 18, 2013
-
-
Jason Evans authored
-
Jason Evans authored
Verify that freed regions are quarantined, and that redzone corruption is detected. Introduce a testing idiom for intercepting/replacing internal functions. In this case the replaced function is ordinarily a static function, but the idiom should work similarly for library-private functions.
-
- Dec 17, 2013
-
-
Jason Evans authored
-
Jason Evans authored
Add hash tests that are based on SMHasher's VerificationTest() function.
-
Jason Evans authored
-
- Dec 16, 2013
-
-
Jason Evans authored
-
Jason Evans authored
Delay reading the mapbits until it's unavoidable.
-
Jason Evans authored
Don't junk fill reallocations for which the request size is less than the current usable size, but not enough smaller to cause a size class change. Unlike malloc()/calloc()/realloc(), *allocx() contractually treats the full usize as the allocation, so a caller can ask for zeroed memory via mallocx() and a series of rallocx() calls that all specify MALLOCX_ZERO, and be assured that all newly allocated bytes will be zeroed and made available to the application without danger of allocator mutation until the size class decreases enough to cause usize reduction.
-
Jason Evans authored
Refactor such that arena_prof_ctx_set() receives usize as an argument, and use it to determine whether to handle ptr as a small region, rather than reading the chunk page map.
-
Jason Evans authored
-
- Dec 14, 2013
-
-
Jason Evans authored
Move je_* definitions from jemalloc_macros.h.in to jemalloc_defs.h.in, because only the latter is an autoconf header (#undef substitution occurs). Fix unit tests to use automatic mangling, so that e.g. mallocx is macro-substituted to becom jet_mallocx.
-
- Dec 13, 2013
-
-
Jason Evans authored
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);
-