summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'dev'2.2.3Jason Evans2011-08-318-140/+175
|\
| * Update ChangeLog for 2.2.3.Jason Evans2011-08-311-0/+14
| |
| * Fix a prof-related race condition.Jason Evans2011-08-311-6/+19
| | | | | | | | | | | | | | | | Fix prof_lookup() to artificially raise curobjs for all paths through the code that creates a new entry in the per thread bt2cnt hash table. This fixes a race condition that could corrupt memory if prof_accum were false, and a non-default lg_prof_tcmax were used and/or threads were destroyed.
| * Fix a prof-related bug in realloc().Jason Evans2011-08-311-3/+8
| | | | | | | | | | Fix realloc() such that it only records the object passed in as freed if no OOM error occurs.
| * Add missing prof_malloc() call in allocm().Jason Evans2011-08-131-3/+2
| | | | | | | | | | | | Add a missing prof_malloc() call in allocm(). Before this fix, negative object/byte counts could be observed in heap profiles for applications that use allocm().
| * Fix off-by-one backtracing issues.Jason Evans2011-08-123-82/+90
| | | | | | | | | | | | | | | | | | | | | | | | Rewrite prof_alloc_prep() as a cpp macro, PROF_ALLOC_PREP(), in order to remove any doubt as to whether an additional stack frame is created. Prior to this change, it was assumed that inlining would reduce the total number of frames in the backtrace, but in practice behavior wasn't completely predictable. Create imemalign() and call it from posix_memalign(), memalign(), and valloc(), so that all entry points require the same number of stack frames to be ignored during backtracing.
| * Document swap.fds mallctl as read-write.Jason Evans2011-08-121-1/+1
| | | | | | | | | | Fix the manual page to document the swap.fds mallctl as read-write, rather than read-only.
| * Conditionalize an isalloc() call in rallocm().Jason Evans2011-08-121-2/+2
| | | | | | | | Conditionalize an isalloc() call in rallocm() that be unnecessary.
| * Fix two prof-related bugs in rallocm().Jason Evans2011-08-122-3/+11
| | | | | | | | | | | | | | Properly handle boundary conditions for sampled region promotion in rallocm(). Prior to this fix, some combinations of 'size' and 'extra' values could cause erroneous behavior. Additionally, size class recording for promoted regions was incorrect.
| * Clean up prof-related comments.Jason Evans2011-08-101-23/+16
| | | | | | | | | | | | | | Clean up some prof-related comments to more accurately reflect how the code works. Simplify OOM handling code in a couple of prof-related error paths.
| * Use prof_tdata_cleanup() argument.Jason Evans2011-08-091-24/+19
| | | | | | | | | | Use the argument to prof_tdata_cleanup(), rather than calling PROF_TCACHE_GET(). This fixes a bug in the NO_TLS case.
| * Adjust relative #include for private_namespace.h.Jason Evans2011-07-311-1/+1
| |
* | Merge branch 'dev'2.2.2Jason Evans2011-07-3181-35/+269
|\ \ | |/
| * Update ChangeLog for 2.2.2.Jason Evans2011-07-301-0/+8
| |
| * Add the --with-private-namespace option.Jason Evans2011-07-305-4/+228
| | | | | | | | | | Add the --with-private-namespace option to make it possible to work around library-private symbols being exposed in static libraries.
| * Fix assertions in arena_purge().Jason Evans2011-06-131-2/+2
| | | | | | | | | | | | | | | | Fix assertions in arena_purge() to accurately reflect the constraints in arena_maybe_purge(). There were two bugs here, one of which merely weakened the assertion, and the other of which referred to an uninitialized variable (typo; used npurgatory instead of arena->npurgatory).
| * Use LLU suffix for all 64-bit constants.Jason Evans2011-05-223-3/+3
| | | | | | | | | | | | Add the LLU suffix for all 0x... 64-bit constants. Reported by Jakob Blomer.
| * Makefile.in - test/allocated requires pthreadNathan McSween2011-05-111-2/+2
| |
| * Adjust repo path dependencies.Jason Evans2011-04-012-24/+24
| | | | | | | | | | Update .gitignore and configure.ac to deal with the recent directory restructuring.
| * Move repo contents in jemalloc/ to top level.Jason Evans2011-04-0179-0/+0
| |
| * Fix a build error for --disable-tcache.Jason Evans2011-03-301-0/+2
| | | | | | | | | | Add a missing #ifdef to conditionally exclude code that is relevant only to the tcache feature.
* | Merge branch 'dev'2.2.1Jason Evans2011-03-303-3/+69
|\ \ | |/
| * Update ChangeLog for 2.2.1.Jason Evans2011-03-301-0/+7
| |
| * Implement atomic operations for x86/x64.Jason Evans2011-03-241-0/+56
| | | | | | | | | | | | Add inline assembly implementations of atomic_{add,sub}_uint{32,64}() for x86/x64, in order to support compilers that are missing the relevant gcc intrinsics.
| * Revert "Add support for libunwind backtrace caching."Jason Evans2011-03-233-94/+16
| | | | | | | | | | | | | | This reverts commit adc675c8ef55b59bb2facf795a3c26411cfbf3ed. The original commit added support for a non-standard libunwind API, so it was not of general utility.
| * Merge branch 'arena_purge' into devJason Evans2011-03-244-19/+100
| |\
| | * Fix an assertion in arena_purge().Jason Evans2011-03-241-3/+6
| | | | | | | | | | | | | | | arena_purge() may be called even when there are no dirty pages, so loosen an assertion accordingly.
| | * Add support for libunwind backtrace caching.je@facebook.com2011-03-243-16/+94
| | | | | | | | | | | | Use libunwind's unw_tdep_trace() if it is available.
* | | Merge branch 'dev'2.2.0Jason Evans2011-03-2335-647/+2009
|\ \ \ | |/ /
| * | Update ChangeLog for 2.2.0.Jason Evans2011-03-221-0/+29
| |/
| * Fix error detection for ipalloc() when profiling.Jason Evans2011-03-234-62/+105
| | | | | | | | | | | | | | | | | | sa2u() returns 0 on overflow, but the profiling code was blindly calling sa2u() and allowing the error to silently propagate, ultimately ending in a later assertion failure. Refactor all ipalloc() callers to call sa2u(), check for overflow before calling ipalloc(), and pass usize rather than size. This allows ipalloc() to avoid calling sa2u() in the common case.
| * Fix rallocm() rsize bug.Jason Evans2011-03-231-0/+2
| | | | | | | | Add code to set *rsize even when profiling is enabled.
| * Fix bootstrapping order bug.Jason Evans2011-03-231-5/+5
| | | | | | | | | | Initialize arenas_tsd earlier, so that the non-TLS case works when profiling is enabled.
| * Avoid overflow in arena_run_regind().Jason Evans2011-03-226-7/+27
| | | | | | | | | | | | | | | | | | | | | | Fix a regression due to: Remove an arena_bin_run_size_calc() constraint. 2a6f2af6e446a98a635caadd281a23ca09a491cb The removed constraint required that small run headers fit in one page, which indirectly limited runs such that they would not cause overflow in arena_run_regind(). Add an explicit constraint to arena_bin_run_size_calc() based on the largest number of regions that arena_run_regind() can handle (2^11 as currently configured).
| * Dynamically adjust tcache fill count.Jason Evans2011-03-213-9/+27
| | | | | | | | | | | | | | | | Dynamically adjust tcache fill count (number of objects allocated per tcache refill) such that if GC has to flush inactive objects, the fill count gradually decreases. Conversely, if refills occur while the fill count is depressed, the fill count gradually increases back to its maximum value.
| * Use OSSpinLock*() for locking on OS X.Jason Evans2011-03-197-12/+69
| | | | | | | | | | | | pthread_mutex_lock() can call malloc() on OS X (!!!), which causes deadlock. Work around this by using spinlocks that are built of more primitive stuff.
| * Add atomic operation support for OS X.Jason Evans2011-03-194-0/+60
| |
| * Update pprof.Jason Evans2011-03-191-49/+160
| | | | | | | | Import updated pprof from google-perftools 1.7.
| * Add atomic.[ch].Jason Evans2011-03-192-0/+79
| | | | | | | | Add atomic.[ch], which should have been part of the previous commit.
| * Add the "stats.cactive" mallctl.Jason Evans2011-03-1916-20/+126
| | | | | | | | | | | | Add the "stats.cactive" mallctl, which can be used to efficiently and repeatedly query approximately how much active memory the application is utilizing.
| * Improve thread-->arena assignment.Jason Evans2011-03-188-16/+101
| | | | | | | | | | | | | | | | Rather than blindly assigning threads to arenas in round-robin fashion, choose the lowest-numbered arena that currently has the smallest number of threads assigned to it. Add the "stats.arenas.<i>.nthreads" mallctl.
| * Reverse tcache fill order.Jason Evans2011-03-181-1/+2
| | | | | | | | | | | | Refill the thread cache such that low regions get used first. This fixes a regression due to the recent transition to bitmap-based region management.
| * Use bitmaps to track small regions.Jason Evans2011-03-1715-139/+702
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous free list implementation, which embedded singly linked lists in available regions, had the unfortunate side effect of causing many cache misses during thread cache fills. Fix this in two places: - arena_run_t: Use a new bitmap implementation to track which regions are available. Furthermore, revert to preferring the lowest available region (as jemalloc did with its old bitmap-based approach). - tcache_t: Move read-only tcache_bin_t metadata into tcache_bin_info_t, and add a contiguous array of pointers to tcache_t in order to track cached objects. This substantially increases the size of tcache_t, but results in much higher data locality for common tcache operations. As a side benefit, it is again possible to efficiently flush the least recently used cached objects, so this change changes flushing from MRU to LRU. The new bitmap implementation uses a multi-level summary approach to make finding the lowest available region very fast. In practice, bitmaps only have one or two levels, though the implementation is general enough to handle extremely large bitmaps, mainly so that large page sizes can still be entertained. Fix tcache_bin_flush_large() to always flush statistics, in the same way that tcache_bin_flush_small() was recently fixed. Use JEMALLOC_DEBUG rather than NDEBUG. Add dassert(), and use it for debug-only asserts.
| * Improve backtracing-related configuration.Jason Evans2011-03-164-83/+140
| | | | | | | | | | | | | | | | | | | | Clean up configuration for backtracing when profiling is enabled, and document the configuration logic in INSTALL. Disable libgcc-based backtracing except on x64 (where it is known to work). Add the --disable-prof-gcc option.
| * Clean up after arena_bin_info_t change.Jason Evans2011-03-161-7/+7
| | | | | | | | Fix a couple of problems related to the addition of arena_bin_info_t.
| * Add missing error checks.Jason Evans2011-03-152-2/+6
| | | | | | | | | | Add missing error checks for pthread_mutex_init() calls. In practice, mutex initialization never fails, so this is merely good hygiene.
| * Create arena_bin_info_t.Jason Evans2011-03-156-223/+324
| | | | | | | | | | Move read-only fields from arena_bin_t into arena_bin_info_t, primarily in order to avoid false cacheline sharing.
| * Fix a build dependency regression.Jason Evans2011-03-151-1/+2
| | | | | | | | | | | | | | Fix the automatic header dependency generation to handle the .pic.o suffix. This regression was due to: Build both PIC and no PIC static libraries af5d6987f829ccd6e14dd1f57586cfb072a533c7
| * Reduce size of small_size2bin lookup table.Jason Evans2011-03-154-41/+52
| | | | | | | | | | | | | | Convert all direct small_size2bin[...] accesses to SMALL_SIZE2BIN(...) macro calls, and use a couple of cheap math operations to allow compacting the table by 4X or 8X, on 32- and 64-bit systems, respectively.
| * Expand a comment regarding geometric sampling.Jason Evans2011-03-151-2/+16
| |