summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * Revert opt_abort and opt_junk refactoring.Jason Evans2013-01-231-2/+14
| | | | | | | | | | | | | | | | Revert refactoring of opt_abort and opt_junk declarations. clang accepts the config_*-based declarations (and generates correct code), but gcc complains with: error: initializer element is not constant
| * Fix quoting bug in --without-export implementation.Jason Evans2013-01-231-1/+1
| |
| * Update phony targets.Jason Evans2013-01-221-2/+2
| | | | | | | | Submitted by Frederik Deweerdt.
| * Use config_* instead of JEMALLOC_*.Jason Evans2013-01-222-14/+4
| | | | | | | | Convert a couple of stragglers from JEMALLOC_* to use config_*.
| * Update hash from MurmurHash2 to MurmurHash3.Jason Evans2013-01-226-128/+336
| | | | | | | | | | | | Update hash from MurmurHash2 to MurmurHash3, primarily because the latter generates 128 bits in a single call for no extra cost, which simplifies integration with cuckoo hashing.
| * Fix AC_PATH_PROG() calls to specify default.Jason Evans2013-01-221-4/+4
| | | | | | | | | | | | | | | | | | | | Fix AC_PATH_PROG() calls to specify 'false' as the default, so that if the configure script fails to find a program, the false program is instead called, and an error occurs. Prior to this fix, if xsltproc could not be found, make would not report an error due to the leading -o in the xsltproc invocation. Reported by David Reiss.
| * Add and use JEMALLOC_ALWAYS_INLINE.Jason Evans2013-01-224-51/+59
| | | | | | | | | | Add JEMALLOC_ALWAYS_INLINE and use it to guarantee that the entire fast paths of the primary allocation/deallocation functions are inlined.
| * Tighten valgrind integration.Jason Evans2013-01-223-22/+31
| | | | | | | | | | | | | | Tighten valgrind integration such that immediately after memory is validated or zeroed, valgrind is told to forget the memory's 'defined' state. The only place newly allocated memory should be left marked as 'defined' is in the public functions (e.g. calloc() and realloc()).
| * Avoid validating freshly mapped memory.Jason Evans2013-01-221-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move validation of supposedly zeroed pages from chunk_alloc() to chunk_recycle(). There is little point to validating newly mapped memory returned by chunk_alloc_mmap(), and memory that comes from sbrk() is explicitly zeroed, so there is little risk to assuming that chunk_alloc_dss() actually does the zeroing properly. This relaxation of validation can make a big difference to application startup time and overall system usage on platforms that use jemalloc as the system allocator (namely FreeBSD). Submitted by Ian Lepore <ian@FreeBSD.org>.
| * Fix build break on *BSDGarrett Cooper2012-12-243-1/+11
| | | | | | | | | | | | | | Linux uses alloca.h; many other operating systems define alloca(3) in stdlib.h. Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
| * Improve configure tests for ffslGarrett Cooper2012-12-241-2/+4
| | | | | | | | | | | | | | | | | | | | In particular: - ffsl always returns int, not long, on FreeBSD, Linux, and OSX. - Mute compiler warnings about rv being unused (and the potential for compilers optimizing out the call completely) by dumping the value with printf(3). Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
| * Don't mangle errno with free(3) if utrace(2) failsGarrett Cooper2012-12-241-0/+2
| | | | | | | | | | | | | | This ensures POLA on FreeBSD (at least) as free(3) is generally assumed to not fiddle around with errno. Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
| * Allow to enable ivsalloc independentlyMike Hommey2012-12-232-2/+23
| |
| * Allow to disable the zone allocator on DarwinMike Hommey2012-12-233-2/+26
| |
| * Add clipping support to lg_chunk option processing.Jason Evans2012-12-232-21/+28
| | | | | | | | | | | | | | | | | | Modify processing of the lg_chunk option so that it clips an out-of-range input to the edge of the valid range. This makes it possible to request the minimum possible chunk size without intimate knowledge of allocator internals. Submitted by Ian Lepore (see FreeBSD PR bin/174641).
| * Fix chunk_recycle() Valgrind integration.Jason Evans2012-12-122-3/+4
| | | | | | | | | | | | | | | | Fix chunk_recycyle() to unconditionally inform Valgrind that returned memory is undefined. This fixes Valgrind warnings that would result from a huge allocation being freed, then recycled for use as an arena chunk. The arena code would write metadata to the chunk header, and Valgrind would consider these invalid writes.
| * Fix "arenas.extend" mallctl to return the number of arenas.Jason Evans2012-11-302-9/+16
| | | | | | | | Reported by Mike Hommey.
| * Allow to build without exporting symbolsMike Hommey2012-11-252-0/+12
| | | | | | | | | | | | When statically linking jemalloc, it may be beneficial not to export its symbols if it makes sense, which allows the compiler and the linker to do some further optimizations.
| * Avoid arena_prof_accum()-related locking when possible.Jason Evans2012-11-135-36/+50
| | | | | | | | | | | | | | Refactor arena_prof_accum() and its callers to avoid arena locking when prof_interval is 0 (as when profiling is disabled). Reported by Ben Maurer.
* | Merge branch 'dev'3.2.0Jason Evans2012-11-097-276/+421
|\ \ | |/
| * Update ChangeLog for 3.2.0.Jason Evans2012-11-091-2/+6
| |
| * Tweak chunk purge order according to fragmentation.Jason Evans2012-11-071-11/+34
| | | | | | | | | | Tweak chunk purge order to purge unfragmented chunks from high to low memory. This facilitates dirty run reuse.
| * document what stats.active does not trackJan Beich2012-11-071-2/+4
| | | | | | | | Based on http://www.canonware.com/pipermail/jemalloc-discuss/2012-March/000164.html
| * Don't register jemalloc's zone allocator if something else already replaced ↵Mike Hommey2012-11-071-1/+11
| | | | | | | | the system default zone
| * Purge unused dirty pages in a fragmentation-reducing order.Jason Evans2012-11-064-221/+337
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Purge unused dirty pages in an order that first performs clean/dirty run defragmentation, in order to mitigate available run fragmentation. Remove the limitation that prevented purging unless at least one chunk worth of dirty pages had accumulated in an arena. This limitation was intended to avoid excessive purging for small applications, but the threshold was arbitrary, and the effect of questionable utility. Relax opt_lg_dirty_mult from 5 to 3. This compensates for increased likelihood of allocating clean runs, given the same ratio of clean:dirty runs, and reduces the potential for repeated purging in pathological large malloc/free loops that push the active:dirty page ratio just over the purge threshold.
| * Fix deadlock in the arenas.purge mallctl.Jason Evans2012-11-041-26/+22
| | | | | | | | | | Fix deadlock in the arenas.purge mallctl due to recursive mutex acquisition.
| * Fix dss/mmap allocation precedence code.Jason Evans2012-10-172-26/+20
| | | | | | | | | | Fix dss/mmap allocation precedence code to use recyclable mmap memory only after primary dss allocation fails.
* | Merge branch 'dev'3.1.0Jason Evans2012-10-1635-333/+1216
|\ \ | |/
| * Update ChangeLog for 3.1.0.Jason Evans2012-10-161-1/+12
| |
| * Add ctl_mutex proection to arena_i_dss_ctl().Jason Evans2012-10-151-0/+2
| | | | | | | | | | Add ctl_mutex proection to arena_i_dss_ctl(), since ctl_stats.narenas is accessed.
| * Add arena-specific and selective dss allocation.Jason Evans2012-10-1323-240/+905
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the "arenas.extend" mallctl, so that it is possible to create new arenas that are outside the set that jemalloc automatically multiplexes threads onto. Add the ALLOCM_ARENA() flag for {,r,d}allocm(), so that it is possible to explicitly allocate from a particular arena. Add the "opt.dss" mallctl, which controls the default precedence of dss allocation relative to mmap allocation. Add the "arena.<i>.dss" mallctl, which makes it possible to set the default dss precedence on a per arena or global basis. Add the "arena.<i>.purge" mallctl, which obsoletes "arenas.purge". Add the "stats.arenas.<i>.dss" mallctl.
| * mark _pthread_mutex_init_calloc_cb as public explicitlyJan Beich2012-10-101-1/+1
| | | | | | | | | | | | | | Mozilla build hides everything by default using visibility pragma and unhides only explicitly listed headers. But this doesn't work on FreeBSD because _pthread_mutex_init_calloc_cb is neither documented nor exposed via any header.
| * Make malloc_usable_size() implementation consistent with prototype.Jason Evans2012-10-091-1/+1
| | | | | | | | | | Use JEMALLOC_USABLE_SIZE_CONST for the malloc_usable_size() implementation as well as the prototype, for consistency's sake.
| * Drop const from malloc_usable_size() argument on Linux.Jason Evans2012-10-093-1/+14
| | | | | | | | | | Drop const from malloc_usable_size() argument on Linux, in order to match the prototype in Linux's malloc.h.
| * Fix fork(2)-related mutex acquisition order.Jason Evans2012-10-091-3/+3
| | | | | | | | | | | | Fix mutex acquisition order inversion for the chunks rtree and the base mutex. Chunks rtree acquisition was introduced by the previous commit, so this bug was short-lived.
| * Fix fork(2)-related deadlocks.Jason Evans2012-10-0910-3/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a library constructor for jemalloc that initializes the allocator. This fixes a race that could occur if threads were created by the main thread prior to any memory allocation, followed by fork(2), and then memory allocation in the child process. Fix the prefork/postfork functions to acquire/release the ctl, prof, and rtree mutexes. This fixes various fork() child process deadlocks, but one possible deadlock remains (intentionally) unaddressed: prof backtracing can acquire runtime library mutexes, so deadlock is still possible if heap profiling is enabled during fork(). This deadlock is known to be a real issue in at least the case of libgcc-based backtracing. Reported by tfengjun.
| * Fix mlockall()/madvise() interaction.Jason Evans2012-10-095-41/+48
| | | | | | | | | | | | | | | | mlockall(2) can cause purging via madvise(2) to fail. Fix purging code to check whether madvise() succeeded, and base zeroed page metadata on the result. Reported by Olivier Lecomte.
| * Fix error return value in thread_tcache_enabled_ctl().Jason Evans2012-10-081-1/+1
| | | | | | | | Reported by Corey Richardson.
| * If sysconf() fails, the number of CPUs is reported as UINT_MAX, not 1 as it ↵Corey Richardson2012-10-081-3/+4
| | | | | | | | should be
| * Remove unused variable and branch (reported by clang-analzyer)Corey Richardson2012-10-081-5/+0
| |
| * Define LG_QUANTUM for hppa.Jason Evans2012-10-081-0/+3
| | | | | | | | Submitted by Jory Pratt.
| * Remove const from __*_hook variable declarations.Jason Evans2012-05-232-5/+6
| | | | | | | | | | Remove const from __*_hook variable declarations, so that glibc can modify them during process forking.
| * Update a comment.Jason Evans2012-05-161-1/+1
| |
| * Disable tcache by default if running inside Valgrind.Jason Evans2012-05-163-1/+8
| | | | | | | | | | Disable tcache by default if running inside Valgrind, in order to avoid making unallocated objects appear reachable to Valgrind.
| * Auto-detect whether running inside Valgrind.Jason Evans2012-05-154-30/+31
| | | | | | | | | | Auto-detect whether running inside Valgrind, thus removing the need to manually specify MALLOC_CONF=valgrind:true.
| * Fix heap profiling crash for realloc(p, 0) case.Jason Evans2012-05-152-1/+6
| | | | | | | | | | Fix prof_realloc() to not call prof_ctx_set() if a sampled object is being freed via realloc(p, 0).
* | Merge branch 'dev'3.0.0Jason Evans2012-05-1274-8056/+10840
|\ \ | |/ | | | | | | | | | | | | | | | | Conflicts: ChangeLog include/jemalloc/internal/chunk.h src/chunk.c src/huge.c src/jemalloc.c test/rallocm.c
| * Update ChangeLog for 3.0.0.Jason Evans2012-05-121-4/+6
| |
| * Return early in _malloc_{pre,post}fork() if uninitialized.Jason Evans2012-05-121-0/+14
| | | | | | | | | | | | | | Avoid mutex operations in _malloc_{pre,post}fork() unless jemalloc has been initialized. Reported by David Xu.
| * Fix large calloc() zeroing bugs.Jason Evans2012-05-113-30/+29
| | | | | | | | | | | | | | | | | | Refactor code such that arena_mapbits_{large,small}_set() always preserves the unzeroed flag, and manually manipulate the unzeroed flag in the one case where it actually gets reset (in arena_chunk_purge()). This fixes unzeroed preservation bugs in arena_run_split() and arena_ralloc_large_grow(). These bugs caused large calloc() to return non-zeroed memory under some circumstances.