summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Move zone registration to zone.cMike Hommey2012-03-302-3/+2
|
* Add a SYS_write definition on systems where it is not defined in headersMike Hommey2012-03-301-0/+3
| | | | | Namely, in the Android NDK headers, SYS_write is not defined; but __NR_write is.
* Add the "thread.tcache.enabled" mallctl.Jason Evans2012-03-271-15/+101
|
* Use __sync_add_and_fetch and __sync_sub_and_fetch when they are availableMike Hommey2012-03-262-3/+31
| | | | | | | These functions may be available as inlines or as libgcc functions. In the former case, a __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n macro is defined. But we still want to use these functions in the latter case, when we don't have our own implementation.
* Remove malloc_mutex_trylock().Jason Evans2012-03-251-15/+0
| | | | Remove malloc_mutex_trylock(); it has not been used for quite some time.
* Port to FreeBSD.Jason Evans2012-02-036-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | Use FreeBSD-specific functions (_pthread_mutex_init_calloc_cb(), _malloc_{pre,post}fork()) to avoid bootstrapping issues due to allocation in libc and libthr. Add malloc_strtoumax() and use it instead of strtoul(). Disable validation code in malloc_vsnprintf() and malloc_strtoumax() until jemalloc is initialized. This is necessary because locale initialization causes allocation for both vsnprintf() and strtoumax(). Force the lazy-lock feature on in order to avoid pthread_self(), because it causes allocation. Use syscall(SYS_write, ...) rather than write(...), because libthr wraps write() and causes allocation. Without this workaround, it would not be possible to print error messages in malloc_conf_init() without substantially reworking bootstrapping. Fix choose_arena_hard() to look at how many threads are assigned to the candidate choice, rather than checking whether the arena is uninitialized. This bug potentially caused more arenas to be initialized than necessary.
* Remove ephemeral mutexes.Jason Evans2012-03-243-6/+41
| | | | | | | | | | | Remove ephemeral mutexes from the prof machinery, and remove malloc_mutex_destroy(). This simplifies mutex management on systems that call malloc()/free() inside pthread_mutex_{create,destroy}(). Add atomic_*_u() for operation on unsigned values. Fix prof_printf() to call malloc_vsnprintf() rather than malloc_snprintf().
* Restructure atomic_*_z().Jason Evans2012-03-231-16/+29
| | | | | Restructure atomic_*_z() so that no casting within macros is necessary. This avoids warnings when compiling with clang.
* Add JEMALLOC_CC_SILENCE_INIT().Jason Evans2012-03-232-5/+12
| | | | | Add JEMALLOC_CC_SILENCE_INIT(), which provides succinct syntax for initializing a variable to avoid a spurious compiler warning.
* Implement tsd.Jason Evans2012-03-239-117/+408
| | | | | | | | | | | | | Implement tsd, which is a TLS/TSD abstraction that uses one or both internally. Modify bootstrapping such that no tsd's are utilized until allocation is safe. Remove malloc_[v]tprintf(), and use malloc_snprintf() instead. Fix %p argument size handling in malloc_vsnprintf(). Fix a long-standing statistics-related bug in the "thread.arena" mallctl that could cause crashes due to linked list corruption.
* Invert NO_TLS to JEMALLOC_TLS.Jason Evans2012-03-194-5/+5
|
* Remove #include <sys/sysctl.h>.Jason Evans2012-03-161-1/+0
| | | | | Remove #include <sys/sysctl.h>, which is no longer needed (now using sysconf(3) to get number of CPUs).
* Fix fork-related bugs.Jason Evans2012-03-137-10/+34
| | | | | | | | | Acquire/release arena bin locks as part of the prefork/postfork. This bug made deadlock in the child between fork and exec a possibility. Split jemalloc_postfork() into jemalloc_postfork_{parent,child}() so that the child can reinitialize mutexes rather than unlocking them. In practice, this bug tended not to cause problems.
* Modify malloc_vsnprintf() validation code.Jason Evans2012-03-131-0/+6
| | | | | | Modify malloc_vsnprintf() validation code to verify that output is identical to vsnprintf() output, even if both outputs are truncated due to buffer exhaustion.
* Implement aligned_alloc().Jason Evans2012-03-132-0/+4
| | | | | | | | Implement aligned_alloc(), which was added in the C11 standard. The function is weakly specified to the point that a minimally compliant implementation would be painful to use (size must be an integral multiple of alignment!), which in practice makes posix_memalign() a safer choice.
* Fix a regression in JE_COMPILABLE().Jason Evans2012-03-131-6/+3
| | | | | | | Revert JE_COMPILABLE() so that it detects link errors. Cross-compiling should still work as long as a valid configure cache is provided. Clean up some comments/whitespace.
* Remove bashism.Jason Evans2012-03-121-1/+1
| | | | Submitted by Mike Hommey.
* Implement malloc_vsnprintf().Jason Evans2012-03-087-91/+177
| | | | | | | | | | | | Implement malloc_vsnprintf() (a subset of vsnprintf(3)) as well as several other printing functions based on it, so that formatted printing can be relied upon without concern for inducing a dependency on floating point runtime support. Replace malloc_write() calls with malloc_*printf() where doing so simplifies the code. Add name mangling for library-private symbols in the data and BSS sections. Adjust CONF_HANDLE_*() macros in malloc_conf_init() to expose all opt_* variable use to cpp so that proper mangling occurs.
* Remove the lg_tcache_gc_sweep option.Jason Evans2012-03-051-12/+11
| | | | | | | Remove the lg_tcache_gc_sweep option, because it is no longer very useful. Prior to the addition of dynamic adjustment of tcache fill count, it was possible for fill/flush overhead to be a problem, but this problem no longer occurs.
* Use UINT64_C() rather than LLU for 64-bit constants.Jason Evans2012-03-052-2/+2
|
* Add SH4 and mips architecture support.Jason Evans2012-03-052-0/+19
| | | | Submitted by Andreas Vinsander.
* Add the --disable-experimental option.Jason Evans2012-03-032-0/+11
|
* Rename prn to prng.Jason Evans2012-03-024-12/+12
| | | | | Rename prn to prng so that Windows doesn't choke when trying to create a file named prn.h.
* Reorder macros.Jason Evans2012-03-022-6/+6
|
* Add --with-mangling.Jason Evans2012-03-024-48/+121
| | | | | | | | | | Add the --with-mangling configure option, which can be used to specify name mangling on a per public symbol basis that takes precedence over --with-jemalloc-prefix. Expose the memalign() and valloc() overrides even if --with-jemalloc-prefix is specified. This change does no real harm, and simplifies the code.
* Add nallocm().Jason Evans2012-02-292-4/+1
| | | | | | | Add nallocm(), which computes the real allocation size that would result from the corresponding allocm() call. nallocm() is a functional superset of OS X's malloc_good_size(), in that it takes alignment constraints into account.
* Use glibc allocator hooks.Jason Evans2012-02-291-4/+0
| | | | | | | | | | | When jemalloc is used as a libc malloc replacement (i.e. not prefixed), some particular setups may end up inconsistently calling malloc from libc and free from jemalloc, or the other way around. glibc provides hooks to make its functions use alternative implementations. Use them. Submitted by Karl Tomlinson and Mike Hommey.
* Remove unused variables in tcache_dalloc_large().Jason Evans2012-02-291-6/+1
| | | | Submitted by Mike Hommey.
* Remove the sysv option.Jason Evans2012-02-292-11/+0
|
* Simplify small size class infrastructure.Jason Evans2012-02-298-151/+211
| | | | | | | | | | | | Program-generate small size class tables for all valid combinations of LG_TINY_MIN, LG_QUANTUM, and PAGE_SHIFT. Use the appropriate table to generate all relevant data structures, and remove the distinction between tiny/quantum/cacheline/subpage bins. Remove --enable-dynamic-page-shift. This option didn't prove useful in practice, and it prevented optimizations. Add Tilera architecture support.
* Remove the opt.lg_prof_bt_max option.Jason Evans2012-02-141-20/+10
| | | | | | | | Remove opt.lg_prof_bt_max, and hard code it to 7. The original intention of this option was to enable faster backtracing by limiting backtrace depth. However, this makes graphical pprof output very difficult to interpret. In practice, decreasing sampling frequency is a better mechanism for limiting profiling overhead.
* Remove the opt.lg_prof_tcmax option.Jason Evans2012-02-141-2/+3
| | | | | | | Remove the opt.lg_prof_tcmax option and hard-code a cache size of 1024. This setting is something that users just shouldn't have to worry about. If lock contention actually ends up being a problem, the simple solution available to the user is to reduce sampling frequency.
* Remove highruns statistics.Jason Evans2012-02-132-6/+4
|
* Make 8-byte tiny size class non-optional.Jason Evans2012-02-133-25/+7
| | | | | | | | | | | When tiny size class support was first added, it was intended to support truly tiny size classes (even 2 bytes). However, this wasn't very useful in practice, so the minimum tiny size class has been limited to sizeof(void *) for a long time now. This is too small to be standards compliant, but other commonly used malloc implementations do not even bother using a 16-byte quantum on systems with vector units (SSE2+, AltiVEC, etc.). As such, it is safe in practice to support an 8-byte tiny size class on 64-bit systems that support 16-byte types.
* Streamline tcache-related malloc/free fast paths.Jason Evans2012-02-132-27/+35
| | | | | | | | | | | tcache_get() is inlined, so do the config_tcache check inside tcache_get() and simplify its callers. Make arena_malloc() an inline function, since it is part of the malloc() fast path. Remove conditional logic that cause build issues if --disable-tcache was specified.
* Remove the swap feature.Jason Evans2012-02-136-48/+0
| | | | | Remove the swap feature, which enabled per application swap files. In practice this feature has not proven itself useful to users.
* Remove magic.Jason Evans2012-02-135-21/+0
| | | | | | Remove structure magic, because 1) it is no longer conditional, and 2) it stopped being very effective at detecting memory corruption several years ago.
* Reduce cpp conditional logic complexity.Jason Evans2012-02-1114-244/+235
| | | | | | | | | | | | | | | | | | | | | | Convert configuration-related cpp conditional logic to use static constant variables, e.g.: #ifdef JEMALLOC_DEBUG [...] #endif becomes: if (config_debug) { [...] } The advantage is clearer, more concise code. The main disadvantage is that data structures no longer have conditionally defined fields, so they pay the cost of all fields regardless of whether they are used. In practice, this is only a minor concern; config_stats will go away in an upcoming change, and config_prof is the only other major feature that depends on more than a few special-purpose fields.
* Fix huge_ralloc to maintain chunk statistics.Jason Evans2011-11-111-1/+1
| | | | | Fix huge_ralloc() to properly maintain chunk statistics when using mremap(2).
* Clean up rb documentation.Jason Evans2011-11-021-46/+46
|
* Fix off-by-one backtracing issues.Jason Evans2011-08-122-69/+54
| | | | | | | | | | | | 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.
* Adjust relative #include for private_namespace.h.Jason Evans2011-07-311-1/+1
|
* Add the --with-private-namespace option.Jason Evans2011-07-303-0/+207
| | | | | Add the --with-private-namespace option to make it possible to work around library-private symbols being exposed in static libraries.
* Use LLU suffix for all 64-bit constants.Jason Evans2011-05-221-1/+1
| | | | | | Add the LLU suffix for all 0x... 64-bit constants. Reported by Jakob Blomer.
* Move repo contents in jemalloc/ to top level.Jason Evans2011-04-0127-0/+5415