summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * Update extent hook function prototype comments.Jason Evans2016-09-291-13/+14
| |
| * Close file descriptor after reading "/proc/sys/vm/overcommit_memory".Jason Evans2016-09-261-0/+1
| | | | | | | | | | | | | | This bug was introduced by c2f970c32b527660a33fa513a76d913c812dcf7c (Modify pages_map() to support mapping uncommitted virtual memory.). This resolves #399.
| * use install command determined by configureThomas Köckerbauer2016-09-261-20/+21
| |
| * Readme.txt error for building in the WindowsBai2016-09-261-1/+1
| | | | | | | | The command can't work using sh -C sh -c "./autogen.sh CC=cl --enable-lazy-lock=no". Change the position of the colon, the command of autogen work.
| * Fix LG_QUANTUM definition for sparc64Eric Le Bihan2016-09-261-1/+1
| | | | | | | | | | | | GCC 4.9.3 cross-compiled for sparc64 defines __sparc_v9__, not __sparc64__ nor __sparcv9. This prevents LG_QUANTUM from being defined properly. Adding this new value to the check solves the issue.
| * Formatting fixes.Jason Evans2016-09-261-9/+12
| |
| * Fix a bug in __builtin_unreachable configure checkElliot Ronaghan2016-09-261-1/+1
| | | | | | | | | | | | | | In 1167e9e, I accidentally tested je_cv_gcc_builtin_ffsl instead of je_cv_gcc_builtin_unreachable (copy-paste error), which meant that JEMALLOC_INTERNAL_UNREACHABLE was always getting defined as abort even if __builtin_unreachable support was detected.
| * Avoid self assignment in tsd_set().Jason Evans2016-09-231-4/+8
| |
| * Add various mutex ownership assertions.Jason Evans2016-09-233-6/+14
| |
| * Fix extent_{before,last,past}() to return page-aligned results.Jason Evans2016-09-231-4/+5
| |
| * Fix large_dalloc_impl() to always lock large_mtx.Jason Evans2016-09-231-4/+7
| |
| * Add new_addr validation in extent_recycle().Jason Evans2016-09-231-6/+28
| |
| * Protect extents_dirty access with extents_mtx.Jason Evans2016-09-225-58/+112
| | | | | | | | This fixes race conditions during purging.
| * Fix extent_recycle() to exclude other arenas' extents.Jason Evans2016-09-221-1/+2
| | | | | | | | | | When attempting to recycle an extent at a specified address, check that the extent belongs to the correct arena.
| * Fix arena_bind().Qi Wang2016-09-221-6/+7
| | | | | | | | | | When tsd is not in nominal state (e.g. during thread termination), we should not increment nthreads.
| * Fix -Wundef in _MSC_VER check.Josh Gao2016-09-151-1/+1
| |
| * Change html manual encoding to UTF-8.Jason Evans2016-09-123-92/+96
| | | | | | | | | | | | | | | | | | | | | | This works around GitHub's broken automatic reformatting from ISO-8859-1 to UTF-8 when serving static html. Remove <parameter/> from e.g. <function>malloc<parameter/></function>, add a custom template that does not append parentheses, and manually specify them, e.g. <function>malloc()</function>. This works around apparently broken XSL formatting that causes <code/> to be emitted in html (rather than <code></code>, or better yet, nothing).
| * Update project URL.Jason Evans2016-09-123-3/+3
| |
| * Change how the default zone is foundMike Hommey2016-07-081-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | On OSX 10.12, malloc_default_zone returns a special zone that is not present in the list of registered zones. That zone uses a "lite zone" if one is present (apparently enabled when malloc stack logging is enabled), or the first registered zone otherwise. In practice this means unless malloc stack logging is enabled, the first registered zone is the default. So get the list of zones to get the first one, instead of relying on malloc_default_zone.
| * Avoid getting the same default zone twice in a row.Mike Hommey2016-07-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | 847ff22 added a call to malloc_default_zone() before the main loop in register_zone, effectively making malloc_default_zone() called twice without any different outcome expected in the returned result. It is also called once at the beginning, and a second time at the end of the loop block. Instead, call it only once per iteration.
| * Disable irrelevant Cray compiler warnings if cc-silence is enabledElliot Ronaghan2016-07-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Cray is pretty warning-happy, so disable ones that aren't helpful. Each warning has a numeric value instead of having named flags to disable specific warnings. Disable warnings 128 and 1357. 128: Ignore unreachable code warning. Cray warns about `not_reached()` not being reachable in a couple of places because it detects that some loops will never terminate. 1357: Ignore warning about redefinition of malloc and friends With this patch, Cray 8.4.0 and 8.5.1 build cleanly and pass `make check`
| * Add Cray compiler's equivalent of -Werror before __attribute__ checksElliot Ronaghan2016-07-071-0/+4
| | | | | | | | | | | | Cray uses -herror_on_warning instead of -Werror. Use it everywhere -Werror is currently used for __attribute__ checks so configure actually detects they're not supported.
| * Disable automatic dependency generation for the Cray compilerElliot Ronaghan2016-07-071-0/+4
| | | | | | | | | | | | | | | | Cray only supports `-M` for generating dependency files. It does not support `-MM` or `-MT`, so don't try to use them. I just reused the existing mechanism for turning auto-dependency generation off (`CC_MM=`), but it might be more principled to add a configure test to check if the compiler supports `-MM` and `-MT`, instead of manually tracking which compilers don't support those flags.
| * Add initial support for building with the cray compilerElliot Ronaghan2016-07-071-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Get jemalloc building and passing `make check_unit` with cray 8.4. An inlining bug in 8.4 results in internal errors while trying to build jemalloc. This has already been reported and fixed for the 8.5 release. In order to work around the inlining bug, disable gnu compatibility and limit ipa optimizations. I copied the msvc compiler check for cray, but note that we perform the test even if we think we're using gcc because cray pretends to be gcc if `-hgnu` (which is enabled by default) is used. I couldn't come up with a principled way to check for the inlining bug, so instead I just checked compiler versions. The build had lots of warnings I need to address and cray doesn't support -MM or -MT for dependency tracking, so I had to do `make CC_MM=`.
| * Fix MSVC projectrustyx2016-07-072-2/+14
| |
| * Check for __builtin_unreachable at configure timeElliot Ronaghan2016-07-073-16/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a configure check for __builtin_unreachable instead of basing its availability on the __GNUC__ version. On OS X using gcc (a real gcc, not the bundled version that's just a gcc front-end) leads to a linker assertion: https://github.com/jemalloc/jemalloc/issues/266 It turns out that this is caused by a gcc bug resulting from the use of __builtin_unreachable(): https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57438 To work around this bug, check that __builtin_unreachable() actually works at configure time, and if it doesn't use abort() instead. The check is based on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57438#c21. With this `make check` passes with a homebrew installed gcc-5 and gcc-6.
| * Fix librt detection when using a Cray compiler wrapperElliot Ronaghan2016-07-072-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Cray compiler wrappers will often add `-lrt` to the base compiler with `-static` linking (the default at most sites.) However, `-lrt` isn't automatically added with `-dynamic`. This means that if jemalloc was built with `-static`, but then used in a program with `-dynamic` jemalloc won't have detected that librt is a dependency. The integration and stress tests use -dynamic, which is causing undefined references to clock_gettime(). This just adds an extra check for librt (ignoring the autoconf cache) with `-dynamic` thrown. It also stops filtering librt from the integration tests. With this `make check` passes for: - PrgEnv-gnu - PrgEnv-intel - PrgEnv-pgi PrgEnv-cray still needs more work (will be in a separate patch.)
| * Add -dynamic for integration and stress tests with Cray compiler wrappersElliot Ronaghan2016-07-072-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cray systems come with compiler wrappers to simplify building parallel applications. CC is the C++ wrapper, and cc is the C wrapper. The wrappers call the base {Cray, Intel, PGI, or GNU} compiler with vendor specific flags. The "Programming Environment" (prgenv) that's currently loaded determines the base compiler. e.g. compiling with gnu looks something like: module load PrgEnv-gnu cc hello.c On most systems the wrappers defaults to `-static` mode, which causes them to only look for static libraries, and not for any dynamic ones (even if the dynamic version was explicitly listed.) The integration and stress tests expect to be using the .so, so we have to run the with -dynamic so that wrapper will find/use the .so.
| * Add Travis-CI configurationMike Hommey2016-07-071-0/+29
| |
| * Define 64-bits atomics unconditionallyMike Hommey2016-06-091-10/+8
| | | | | | | | They are used on all platforms in prng.h.
| * Fix extent_*_get to build with MSVCMike Hommey2016-06-091-4/+4
| |
| * Add an AppVeyor configMike Hommey2016-06-091-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | This builds jemalloc and runs all checks with: - MSVC 2015 64-bits - MSVC 2015 32-bits - MINGW64 (from msys2) - MINGW32 (from msys2) Normally, AppVeyor configs are named appveyor.yml, but it is possible to configure the .yml file name in the AppVeyor project settings such that the file stays "hidden", like typical travis configs.
| * Don't use compact red-black trees with the pgi compilerElliot Ronaghan2016-06-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some bug (either in the red-black tree code, or in the pgi compiler) seems to cause red-black trees to become unbalanced. This issue seems to go away if we don't use compact red-black trees. Since red-black trees don't seem to be used much anymore, I opted for what seems to be an easy fix here instead of digging in and trying to find the root cause of the bug. Some context in case it's helpful: I experienced a ton of segfaults while using pgi as Chapel's target compiler with jemalloc 4.0.4. The little bit of debugging I did pointed me somewhere deep in red-black tree manipulation, but I didn't get a chance to investigate further. It looks like 4.2.0 replaced most uses of red-black trees with pairing-heaps, which seems to avoid whatever bug I was hitting. However, `make check_unit` was still failing on the rb test, so I figured the core issue was just being masked. Here's the `make check_unit` failure: ```sh === test/unit/rb === test_rb_empty: pass tree_recurse:test/unit/rb.c:90: Failed assertion: (((_Bool) (((uintptr_t) (left_node)->link.rbn_right_red) & ((size_t)1)))) == (false) --> true != false: Node should be black test_rb_random:test/unit/rb.c:274: Failed assertion: (imbalances) == (0) --> 1 != 0: Tree is unbalanced tree_recurse:test/unit/rb.c:90: Failed assertion: (((_Bool) (((uintptr_t) (left_node)->link.rbn_right_red) & ((size_t)1)))) == (false) --> true != false: Node should be black test_rb_random:test/unit/rb.c:274: Failed assertion: (imbalances) == (0) --> 1 != 0: Tree is unbalanced node_remove:test/unit/rb.c:190: Failed assertion: (imbalances) == (0) --> 2 != 0: Tree is unbalanced <jemalloc>: test/unit/rb.c:43: Failed assertion: "pathp[-1].cmp < 0" test/test.sh: line 22: 12926 Aborted Test harness error ``` While starting to debug I saw the RB_COMPACT option and decided to check if turning that off resolved the bug. It seems to have fixed it (`make check_unit` passes and the segfaults under Chapel are gone) so it seems like on okay work-around. I'd imagine this has performance implications for red-black trees under pgi, but if they're not going to be used much anymore it's probably not a big deal.
| * Work around a weird pgi bug in test/unit/math.cElliot Ronaghan2016-06-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pgi fails to compile math.c, reporting that `-INFINITY` in `pt_norm_expected[]` is a "Non-constant" expression. A simplified version of this failure is: ```c #include <math.h> static double inf1, inf2 = INFINITY; // no complaints static double inf3 = INFINITY; // suddenly INFINITY is "Non-constant" int main() { } ``` ```sh PGC-S-0074-Non-constant expression in initializer (t.c: 4) ``` pgi errors on the declaration of inf3, and will compile fine if that line is removed. I've reported this bug to pgi, but in the meantime I just switched to using (DBL_MAX + DBL_MAX) to work around this bug.
| * Update ChangeLog for 4.2.1.Jason Evans2016-06-081-0/+11
| |
| * Fix potential VM map fragmentation regression.Jason Evans2016-06-072-2/+2
| | | | | | | | | | | | | | | | Revert 245ae6036c09cc11a72fab4335495d95cddd5beb (Support --with-lg-page values larger than actual page size.), because it could cause VM map fragmentation if the kernel grows mmap()ed memory downward. This resolves #391.
| * Fix mixed decl in nstime.cElliot Ronaghan2016-06-071-3/+5
| | | | | | | | Fix mixed decl in the gettimeofday() branch of nstime_update()
| * Propagate tsdn to default extent hooks.Jason Evans2016-06-071-25/+78
| | | | | | | | | | | | | | This avoids bootstrapping issues for configurations that require allocation during tsd initialization. This resolves #390.
| * Use extent_commit_wrapper() rather than directly calling commit hook.Jason Evans2016-06-061-3/+2
| | | | | | | | | | As a side effect this causes the extent's 'committed' flag to be updated.
| * Set 'committed' in extent_[de]commit_wrapper().Jason Evans2016-06-061-8/+13
| |
| * Relax extent hook tests to work with unsplittable extents.Jason Evans2016-06-061-8/+19
| |
| * Fix regressions related extent splitting failures.Jason Evans2016-06-062-4/+8
| | | | | | | | | | | | | | | | | | | | Fix a fundamental extent_split_wrapper() bug in an error path. Fix extent_recycle() to deregister unsplittable extents before leaking them. Relax xallocx() test assertions so that unsplittable extents don't cause test failures.
| * Fix an extent [de]allocation/[de]registration race.Jason Evans2016-06-061-4/+17
| | | | | | | | | | Deregister extents before deallocation, so that subsequent reallocation/registration doesn't race with deregistration.
| * Fix extent_alloc_dss() regressions.Jason Evans2016-06-064-22/+33
| | | | | | | | | | Page-align the gap, if any, and add/use extent_dalloc_gap(), which registers the gap extent before deallocation.
| * Fix gdump triggering regression.Jason Evans2016-06-061-13/+11
| | | | | | | | | | Now that extents are not multiples of chunksize, it's necessary to track pages rather than chunks.
| * Work around legitimate xallocx() failures during testing.Jason Evans2016-06-061-6/+12
| | | | | | | | | | | | | | | | | | | | With the removal of subchunk size class infrastructure, there are no large size classes that are guaranteed to be re-expandable in place unless munmap() is disabled. Work around these legitimate failures with rallocx() fallback calls. If there were no test configuration for which the xallocx() calls succeeded, it would be important to override the extent hooks for testing purposes, but by default these tests don't use the rallocx() fallbacks on Linux, so test coverage is still sufficient.
| * Remove a stray memset(), and fix a junk filling test regression.Jason Evans2016-06-064-7/+34
| |
| * Silence a bogus compiler warning.Jason Evans2016-06-061-1/+3
| |
| * Fix locking order reversal in arena_reset().Jason Evans2016-06-061-5/+13
| |
| * Modify extent hook functions to take an (extent_t *) argument.Jason Evans2016-06-0610-311/+308
| | | | | | | | | | | | | | This facilitates the application accessing its own extent allocator metadata during hook invocations. This resolves #259.