- Feb 01, 2013
-
-
Jason Evans authored
Fix a chunk recycling bug that could cause the allocator to lose track of whether a chunk was zeroed. On FreeBSD, NetBSD, and OS X, it could cause corruption if allocating via sbrk(2) (unlikely unless running with the "dss:primary" option specified). This was completely harmless on Linux unless using mlockall(2) (and unlikely even then, unless the --disable-munmap configure option or the "dss:primary" option was specified). This regression was introduced in 3.1.0 by the mlockall(2)/madvise(2) interaction fix.
-
- Jan 31, 2013
-
-
Jason Evans authored
Internal reallocation of the quarantined object array leaked the old array. Reallocation failure for internal reallocation of the quarantined object array (very unlikely) resulted in memory corruption.
-
Jason Evans authored
Avoid writing to uninitialized TLS as a side effect of deallocation. Initializing TLS during deallocation is unsafe because it is possible that a thread never did any allocation, and that TLS has already been deallocated by the threads library, resulting in write-after-free corruption. These fixes affect prof_tdata and quarantine; all other uses of TLS are already safe, whether intentionally (as for tcache) or unintentionally (as for arenas).
-
- Jan 23, 2013
-
-
Jason Evans authored
-
Jason Evans authored
-
Jason Evans authored
Specify both inline and __attribute__((always_inline)), in order to avoid warnings when using newer versions of gcc.
-
Jason Evans authored
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
-
Jason Evans authored
-
- Jan 22, 2013
-
-
Jason Evans authored
Submitted by Frederik Deweerdt.
-
Jason Evans authored
Convert a couple of stragglers from JEMALLOC_* to use config_*.
-
Jason Evans authored
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.
-
Jason Evans authored
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.
-
Jason Evans authored
Add JEMALLOC_ALWAYS_INLINE and use it to guarantee that the entire fast paths of the primary allocation/deallocation functions are inlined.
-
Jason Evans authored
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()).
-
Jason Evans authored
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>.
-
- Dec 24, 2012
-
-
Garrett Cooper authored
Linux uses alloca.h; many other operating systems define alloca(3) in stdlib.h. Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
-
Garrett Cooper authored
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>
-
Garrett Cooper authored
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>
-
- Dec 23, 2012
-
-
Mike Hommey authored
-
Mike Hommey authored
-
Jason Evans authored
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).
-
- Dec 12, 2012
-
-
Jason Evans authored
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.
-
- Nov 30, 2012
-
-
Jason Evans authored
Reported by Mike Hommey.
-
- Nov 25, 2012
-
-
Mike Hommey authored
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.
-
- Nov 13, 2012
-
-
Jason Evans authored
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.
-
- Nov 09, 2012
-
-
Jason Evans authored
-
Jason Evans authored
-
- Nov 07, 2012
-
-
Jason Evans authored
Tweak chunk purge order to purge unfragmented chunks from high to low memory. This facilitates dirty run reuse.
-
Mike Hommey authored
-
- Nov 06, 2012
-
-
Jason Evans authored
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.
-
- Nov 04, 2012
-
-
Jason Evans authored
Fix deadlock in the arenas.purge mallctl due to recursive mutex acquisition.
-
- Oct 17, 2012
-
-
Jason Evans authored
Fix dss/mmap allocation precedence code to use recyclable mmap memory only after primary dss allocation fails.
-
- Oct 16, 2012
-
-
Jason Evans authored
-
Jason Evans authored
-
- Oct 15, 2012
-
-
Jason Evans authored
Add ctl_mutex proection to arena_i_dss_ctl(), since ctl_stats.narenas is accessed.
-
- Oct 13, 2012
-
-
Jason Evans authored
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.
-
- Oct 10, 2012
-
-
Jan Beich authored
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.
-
Jason Evans authored
Use JEMALLOC_USABLE_SIZE_CONST for the malloc_usable_size() implementation as well as the prototype, for consistency's sake.
-
Jason Evans authored
Drop const from malloc_usable_size() argument on Linux, in order to match the prototype in Linux's malloc.h.
-