summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * Force initialization of the init_lock in malloc_init_hard on Windows XPMike Hommey2015-09-041-1/+15
| | | | | | | | This resolves #269.
| * Fix pointer comparision with undefined behavior.Jason Evans2015-09-041-2/+2
| | | | | | | | | | | | | | This didn't cause bad code generation in the one case spot-checked (gcc 4.8.1), but had the potential to to so. This bug was introduced by 594c759f37c301d0245dc2accf4d4aaf9d202819 (Optimize arena_prof_tctx_set().).
| * Optimize arena_prof_tctx_set().Jason Evans2015-09-024-28/+56
| | | | | | | | | | Optimize arena_prof_tctx_set() to avoid reading run metadata when deciding whether it's actually necessary to write.
| * Fix TLS configuration.Jason Evans2015-09-022-8/+16
| | | | | | | | | | | | | | | | Fix TLS configuration such that it is enabled by default for platforms on which it works correctly. This regression was introduced by ac5db02034c01357a4ce90504886046a58117921 (Make --enable-tls and --enable-lazy-lock take precedence over configure.ac-hardcoded defaults).
| * Don't purge junk filled chunks when shrinking huge allocationsMike Hommey2015-08-282-6/+12
| | | | | | | | | | | | | | | | When junk filling is enabled, shrinking an allocation fills the bytes that were previously allocated but now aren't. Purging the chunk before doing that is just a waste of time. This resolves #260.
| * Fix chunk purge hook calls for in-place huge shrinking reallocation.Mike Hommey2015-08-282-2/+6
| | | | | | | | | | | | | | | | | | | | Fix chunk purge hook calls for in-place huge shrinking reallocation to specify the old chunk size rather than the new chunk size. This bug caused no correctness issues for the default chunk purge function, but was visible to custom functions set via the "arena.<i>.chunk_hooks" mallctl. This resolves #264.
| * Fix arenas_cache_cleanup() and arena_get_hard().Jason Evans2015-08-282-9/+8
| | | | | | | | | | | | | | | | | | Fix arenas_cache_cleanup() and arena_get_hard() to handle allocation/deallocation within the application's thread-specific data cleanup functions even after arenas_cache is torn down. This is a more general fix that complements 45e9f66c280e1ba8bebf7bed387a43bc9e45536d (Fix arenas_cache_cleanup().).
| * Add JEMALLOC_CXX_THROW to the memalign() function prototype.Jason Evans2015-08-262-1/+4
| | | | | | | | | | | | | | | | | | | | Add JEMALLOC_CXX_THROW to the memalign() function prototype, in order to match glibc and avoid compilation errors when including both jemalloc/jemalloc.h and malloc.h in C++ code. This change was unintentionally omitted from ae93d6bf364e9db9f9ee69c3e5f9df110d8685a4 (Avoid function prototype incompatibilities.).
| * Fix arenas_cache_cleanup().Christopher Ferris2015-08-213-2/+15
| | | | | | | | | | | | Fix arenas_cache_cleanup() to handle allocation/deallocation within the application's thread-specific data cleanup functions even after arenas_cache is torn down.
| * Silence compiler warnings for unreachable code.Jason Evans2015-08-201-12/+14
| | | | | | | | Reported by Ingvar Hagelund.
| * Rename index_t to szind_t to avoid an existing type on Solaris.Jason Evans2015-08-197-70/+71
| | | | | | | | This resolves #256.
| * Don't bitshift by negative amounts.Jason Evans2015-08-194-13/+50
|/ | | | | | | | Don't bitshift by negative amounts when encoding/decoding run sizes in chunk header maps. This affected systems with page sizes greater than 8 KiB. Reported by Ingvar Hagelund <ingvar@redpill-linpro.com>.
* Merge branch 'dev'4.0.0Jason Evans2015-08-17131-9046/+16699
|\
| * Update ChangeLog for 4.0.0.Jason Evans2015-08-171-2/+1
| |
| * Improve arena.<i>.chunk_hooks documentation formatting.Jason Evans2015-08-141-37/+46
| |
| * Update in-place reallocation documentation.Jason Evans2015-08-141-3/+9
| |
| * Update large/huge size class cutoff documentation.Jason Evans2015-08-141-9/+9
| |
| * Fix a comment.Jason Evans2015-08-131-1/+1
| |
| * Fix gcc build failure (define __has_builtin).Jason Evans2015-08-121-0/+3
| |
| * Check whether gcc version supports __builtin_unreachable().Jason Evans2015-08-121-0/+11
| |
| * Fix a strict aliasing violation.Jason Evans2015-08-121-1/+6
| |
| * Fix test for MinGW.Jason Evans2015-08-121-11/+15
| |
| * Fix chunk_dalloc_arena() re: zeroing due to purge.Jason Evans2015-08-121-1/+1
| |
| * Update list of private symbols.Jason Evans2015-08-121-25/+14
| |
| * Fix assertion in test.Jason Evans2015-08-121-1/+1
| |
| * Remove obsolete entry.Jason Evans2015-08-121-4/+0
| |
| * Stop forcing --enable-munmap on MinGW.Jason Evans2015-08-122-8/+1
| | | | | | | | | | This is no longer necessary because of the more general chunk merge/split approach to dealing with map coalescing.
| * Try to decommit new chunks.Jason Evans2015-08-124-15/+27
| | | | | | | | Always leave decommit disabled on non-Windows systems.
| * Refactor arena_mapbits_{small,large}_set() to not preserve unzeroed.Jason Evans2015-08-113-54/+73
| | | | | | | | | | Fix arena_run_split_large_helper() to treat newly committed memory as zeroed.
| * Fix build failure.Jason Evans2015-08-111-1/+1
| | | | | | | | | | | | | | | | This regression was introduced by de249c8679a188065949f2560b1f0015ea6534b4 (Arena chunk decommit cleanups and fixes.). This resolves #254.
| * Make --enable-tls and --enable-lazy-lock take precedence over ↵Mike Hommey2015-08-111-5/+9
| | | | | | | | configure.ac-hardcoded defaults
| * Refactor arena_mapbits unzeroed flag management.Jason Evans2015-08-114-37/+35
| | | | | | | | | | | | Only set the unzeroed flag when initializing the entire mapbits entry, rather than mutating just the unzeroed bit. This simplifies the possible mapbits state transitions.
| * Arena chunk decommit cleanups and fixes.Jason Evans2015-08-115-29/+55
| | | | | | | | | | Decommit arena chunk header during chunk deallocation if the rest of the chunk is decommitted.
| * Add no-OOM assertions to test.Jason Evans2015-08-071-6/+12
| |
| * Implement chunk hook support for page run commit/decommit.Jason Evans2015-08-0715-267/+545
| | | | | | | | | | | | | | | | | | Cascade from decommit to purge when purging unused dirty pages, so that it is possible to decommit cleaned memory rather than just purging. For non-Windows debug builds, decommit runs rather than purging them, since this causes access of deallocated runs to segfault. This resolves #251.
| * Fix an in-place growing large reallocation regression.Jason Evans2015-08-071-5/+6
| | | | | | | | | | | | | | | | Fix arena_ralloc_large_grow() to properly account for large_pad, so that in-place large reallocation succeeds when possible, rather than always failing. This regression was introduced by 8a03cf039cd06f9fa6972711195055d865673966 (Implement cache index randomization for large allocations.)
| * work around _FORTIFY_SOURCE false positiveDaniel Micay2015-08-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | In builds with profiling disabled (default), the opt_prof_prefix array has a one byte length as a micro-optimization. This will cause the usage of write in the unused profiling code to be statically detected as a buffer overflow by Bionic's _FORTIFY_SOURCE implementation as it tries to detect read overflows in addition to write overflows. This works around the problem by informing the compiler that not_reached() means code in unreachable in release builds.
| * MSVC compatibility changesMatthijs2015-08-044-16/+45
| | | | | | | | | | | | - Decorate public function with __declspec(allocator) and __declspec(restrict), just like MSVC 1900 - Support JEMALLOC_HAS_RESTRICT by defining the restrict keyword - Move __declspec(nothrow) between 'void' and '*' so it compiles once more
| * Generalize chunk management hooks.Jason Evans2015-08-0420-553/+1022
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the "arena.<i>.chunk_hooks" mallctl, which replaces and expands on the "arena.<i>.chunk.{alloc,dalloc,purge}" mallctls. The chunk hooks allow control over chunk allocation/deallocation, decommit/commit, purging, and splitting/merging, such that the application can rely on jemalloc's internal chunk caching and retaining functionality, yet implement a variety of chunk management mechanisms and policies. Merge the chunks_[sz]ad_{mmap,dss} red-black trees into chunks_[sz]ad_retained. This slightly reduces how hard jemalloc tries to honor the dss precedence setting; prior to this change the precedence setting was also consulted when recycling chunks. Fix chunk purging. Don't purge chunks in arena_purge_stashed(); instead deallocate them in arena_unstash_purged(), so that the dirty memory linkage remains valid until after the last time it is used. This resolves #176 and #201.
| * Implement support for non-coalescing maps on MinGW.Jason Evans2015-07-257-4/+44
| | | | | | | | | | | | | | | | - Do not reallocate huge objects in place if the number of backing chunks would change. - Do not cache multi-chunk mappings. This resolves #213.
| * Fix huge_ralloc_no_move() to succeed more often.Jason Evans2015-07-252-3/+4
| | | | | | | | | | | | | | | | Fix huge_ralloc_no_move() to succeed if an allocation request results in the same usable size as the existing allocation, even if the request size is smaller than the usable size. This bug did not cause correctness issues, but it could cause unnecessary moves during reallocation.
| * Fix huge_palloc() to handle size rather than usize input.Jason Evans2015-07-242-7/+13
| | | | | | | | | | | | | | | | | | | | huge_ralloc() passes a size that may not be precisely a size class, so make huge_palloc() handle the more general case of a size input rather than usize. This regression appears to have been introduced by the addition of in-place huge reallocation; as such it was never incorporated into a release.
| * Fix sa2u() regression.Jason Evans2015-07-241-1/+1
| | | | | | | | | | | | | | | | | | Take large_pad into account when determining whether an aligned allocation can be satisfied by a large size class. This regression was introduced by 8a03cf039cd06f9fa6972711195055d865673966 (Implement cache index randomization for large allocations.).
| * Change arena_palloc_large() parameter from size to usize.Jason Evans2015-07-241-12/+12
| | | | | | | | | | This change merely documents that arena_palloc_large() always receives usize as its argument.
| * Leave PRI* macros defined after using them to define FMT*.Jason Evans2015-07-231-11/+0
| | | | | | | | | | Macro expansion happens too late for the #undef directives to work as a mechanism for preventing accidental direct use of the PRI* macros.
| * Force lazy_lock on MinGW.Jason Evans2015-07-231-0/+1
| | | | | | | | This resolves #83.
| * Fix MinGW-related portability issues.Jason Evans2015-07-2318-494/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | Create and use FMT* macros that are equivalent to the PRI* macros that inttypes.h defines. This allows uniform use of the Unix-specific format specifiers, e.g. "%zu", as well as avoiding Windows-specific definitions of e.g. PRIu64. Add ffs()/ffsl() support for compiling with gcc. Extract compatibility definitions of ENOENT, EINVAL, EAGAIN, EPERM, ENOMEM, and ENORANGE into include/msvc_compat/windows_extra.h and use the file for tests as well as for core jemalloc code.
| * Fix a compilation error.Jason Evans2015-07-221-8/+10
| | | | | | | | | | This regression was introduced by 1b0e4abbfdbcc1c1a71d1f617adb19951109bfce (Port mq_get() to MinGW.).
| * Add JEMALLOC_FORMAT_PRINTF().Jason Evans2015-07-228-20/+54
| | | | | | | | | | | | Replace JEMALLOC_ATTR(format(printf, ...). with JEMALLOC_FORMAT_PRINTF(), so that configuration feature tests can omit the attribute if it would cause extraneous compilation warnings.
| * Port mq_get() to MinGW.Jason Evans2015-07-213-13/+39
| |