summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * Add missing prototypes.Jason Evans2013-12-171-2/+7
| |
| * Add quarantine unit tests.Jason Evans2013-12-177-15/+193
| | | | | | | | | | | | | | | | | | Verify that freed regions are quarantined, and that redzone corruption is detected. Introduce a testing idiom for intercepting/replacing internal functions. In this case the replaced function is ordinarily a static function, but the idiom should work similarly for library-private functions.
| * Fix a typo in a string constant.Jason Evans2013-12-171-1/+1
| |
| * Add hash (MurmurHash3) tests.Jason Evans2013-12-173-4/+170
| | | | | | | | Add hash tests that are based on SMHasher's VerificationTest() function.
| * Add ckh unit tests.Jason Evans2013-12-172-3/+210
| |
| * Add rallocx() test of both alignment and zeroing.Jason Evans2013-12-161-5/+17
| |
| * Finish arena_prof_ctx_set() optimization.Jason Evans2013-12-161-7/+7
| | | | | | | | Delay reading the mapbits until it's unavoidable.
| * Don't junk-fill reallocations unless usize changes.Jason Evans2013-12-163-16/+4
| | | | | | | | | | | | | | | | | | | | | | Don't junk fill reallocations for which the request size is less than the current usable size, but not enough smaller to cause a size class change. Unlike malloc()/calloc()/realloc(), *allocx() contractually treats the full usize as the allocation, so a caller can ask for zeroed memory via mallocx() and a series of rallocx() calls that all specify MALLOCX_ZERO, and be assured that all newly allocated bytes will be zeroed and made available to the application without danger of allocator mutation until the size class decreases enough to cause usize reduction.
| * Optimize arena_prof_ctx_set().Jason Evans2013-12-163-78/+99
| | | | | | | | | | | | Refactor such that arena_prof_ctx_set() receives usize as an argument, and use it to determine whether to handle ptr as a small region, rather than reading the chunk page map.
| * Add zero/align tests for rallocx().Jason Evans2013-12-152-1/+122
| |
| * Fix name mangling issues.Jason Evans2013-12-134-36/+37
| | | | | | | | | | | | | | | | | | Move je_* definitions from jemalloc_macros.h.in to jemalloc_defs.h.in, because only the latter is an autoconf header (#undef substitution occurs). Fix unit tests to use automatic mangling, so that e.g. mallocx is macro-substituted to becom jet_mallocx.
| * Implement the *allocx() API.Jason Evans2013-12-1319-270/+859
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement the *allocx() API, which is a successor to the *allocm() API. The *allocx() functions are slightly simpler to use because they have fewer parameters, they directly return the results of primary interest, and mallocx()/rallocx() avoid the strict aliasing pitfall that allocm()/rallocx() share with posix_memalign(). The following code violates strict aliasing rules: foo_t *foo; allocm((void **)&foo, NULL, 42, 0); whereas the following is safe: foo_t *foo; void *p; allocm(&p, NULL, 42, 0); foo = (foo_t *)p; mallocx() does not have this problem: foo_t *foo = (foo_t *)mallocx(42, 0);
| * Fix a strict aliasing violation.Jason Evans2013-12-121-2/+4
| |
| * Fix a malloc_mutex dependency in mtx.Jason Evans2013-12-121-1/+1
| |
| * Fix a strict aliasing violation.Jason Evans2013-12-121-2/+6
| |
| * Streamline test output.Jason Evans2013-12-122-13/+16
| |
| * Add mq (message queue) to test infrastructure.Jason Evans2013-12-1221-131/+441
| | | | | | | | | | | | | | | | | | Add mtx (mutex) to test infrastructure, in order to avoid bootstrapping complications that would result from directly using malloc_mutex. Rename test infrastructure's thread abstraction from je_thread to thd. Fix some header ordering issues.
| * Clean up SFMT test.Jason Evans2013-12-101-43/+40
| | | | | | | | | | | | | | | | Refactor array declarations to remove some dubious casts. Reduce array size to what is actually used. Extract magic numbers into cpp macro definitions.
| * Fix inline-related macro issues.Jason Evans2013-12-106-65/+43
| | | | | | | | | | | | | | | | | | Add JEMALLOC_INLINE_C and use it instead of JEMALLOC_INLINE in .c files, so that the annotated functions are always static. Remove SFMT's inline-related macros and use jemalloc's instead, so that there's no danger of interactions with jemalloc's definitions that disable inlining for debug builds.
| * Silence some unused variable warnings.Jason Evans2013-12-101-4/+4
| |
| * Add probabability distribution utility code.Jason Evans2013-12-1011-48/+731
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add probabability distribution utility code that enables generation of random deviates drawn from normal, Chi-square, and Gamma distributions. Fix format strings in several of the assert_* macros (remove a %s). Clean up header issues; it's critical that system headers are not included after internal definitions potentially do things like: #define inline Fix the build system to incorporate header dependencies for the test library C files.
| * Integrate SFMT 1.3.3 into test infrastructure.Jason Evans2013-12-0922-1/+3876
| | | | | | | | | | | | | | | | | | | | | | | | Integrate the SIMD-oriented Fast Mersenne Twister (SFMT) 1.3.3 into the test infrastructure. The sfmt_t state encapsulation modification comes from Crux (http://www.canonware.com/Crux/) and enables multiple concurrent PRNGs. test/unit/SFMT.c is an adaptation of SFMT's test.c that performs all the same validation, both for 32- and 64-bit generation.
| * Normalize #define whitespace.Jason Evans2013-12-0916-58/+58
| | | | | | | | Consistently use a tab rather than a space following #define.
| * Refactor tests.Jason Evans2013-12-0931-671/+843
| | | | | | | | | | | | | | Refactor tests to use explicit testing assertions, rather than diff'ing test output. This makes the test code a bit shorter, more explicitly encodes testing intent, and makes test failure diagnosis more straightforward.
| * Make jemalloc.h formatting more consistent.Jason Evans2013-12-074-63/+66
| |
| * Add test code coverage analysis.Jason Evans2013-12-077-10/+127
| | | | | | | | Add test code coverage analysis based on gcov.
| * Disable floating point code/linking when possible.Jason Evans2013-12-063-5/+28
| | | | | | | | | | | | | | | | | | | | | | Unless heap profiling is enabled, disable floating point code and don't link with libm. This, in combination with e.g. EXTRA_CFLAGS=-mno-sse on x64 systems, makes it possible to completely disable floating point register use. Some versions of glibc neglect to save/restore caller-saved floating point registers during dynamic lazy symbol loading, and the symbol loading code uses whatever malloc the application happens to have linked/loaded with, the result being potential floating point register corruption.
| * Fix more test refactoring issues.Jason Evans2013-12-068-109/+113
| |
| * Fix test refactoring issues for Linux.Jason Evans2013-12-064-35/+34
| |
| * Add tsd test.Jason Evans2013-12-054-4/+68
| | | | | | | | Submitted by Mike Hommey.
| * Fix build target to be build_lib, as documented.Jason Evans2013-12-041-2/+2
| | | | | | | | Reported by Michael Truog.
| * Refactor to support more varied testing.Jason Evans2013-12-0448-940/+1337
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor the test harness to support three types of tests: - unit: White box unit tests. These tests have full access to all internal jemalloc library symbols. Though in actuality all symbols are prefixed by jet_, macro-based name mangling abstracts this away from test code. - integration: Black box integration tests. These tests link with the installable shared jemalloc library, and with the exception of some utility code and configure-generated macro definitions, they have no access to jemalloc internals. - stress: Black box stress tests. These tests link with the installable shared jemalloc library, as well as with an internal allocator with symbols prefixed by jet_ (same as for unit tests) that can be used to allocate data structures that are internal to the test code. Move existing tests into test/{unit,integration}/ as appropriate. Split out internal parts of jemalloc_defs.h.in and put them in jemalloc_internal_defs.h.in. This reduces internals exposure to applications that #include <jemalloc/jemalloc.h>. Refactor jemalloc.h header generation so that a single header file results, and the prototypes can be used to generate jet_ prototypes for tests. Split jemalloc.h.in into multiple parts (jemalloc_defs.h.in, jemalloc_macros.h.in, jemalloc_protos.h.in, jemalloc_mangle.h.in) and use a shell script to generate a unified jemalloc.h at configure time. Change the default private namespace prefix from "" to "je_". Add missing private namespace mangling. Remove hard-coded private_namespace.h. Instead generate it and private_unnamespace.h from private_symbols.txt. Use similar logic for public symbols, which aids in name mangling for jet_ symbols. Add test_warn() and test_fail(). Replace existing exit(1) calls with test_fail() calls.
| * Avoid deprecated sbrk(2) on OS X.Jason Evans2013-12-042-8/+15
| | | | | | | | | | Avoid referencing sbrk(2) on OS X, because it is deprecated as of OS X 10.9 (Mavericks), and the compiler warns against using it.
| * Remove unused variable.Jason Evans2013-12-021-1/+0
| |
| * Clean up malloc_ncpus().Jason Evans2013-11-301-8/+1
| | | | | | | | | | | | | | Clean up malloc_ncpus() by replacing incorrectly indented if..else branches with a ?: expression. Submitted by Igor Podlesny.
| * Fix ALLOCM_ARENA(a) handling in rallocm().Jason Evans2013-11-262-5/+7
| | | | | | | | | | | | | | Fix rallocm() to use the specified arena for allocation, not just deallocation. Clarify ALLOCM_ARENA(a) documentation.
| * Fix a potential infinite loop during thread exit.Jason Evans2013-11-201-1/+1
| | | | | | | | | | | | | | | | | | Fix malloc_tsd_dalloc() to bypass tcache when dallocating, so that there is no danger of causing tcache reincarnation during thread exit. Whether this infinite loop occurs depends on the pthreads TSD implementation; it is known to occur on Solaris. Submitted by Markus Eberspächer.
| * Add ids for all mallctl entries.Jason Evans2013-10-301-69/+69
| | | | | | | | | | Add ids for all mallctl entries, so that external documents can link to arbitrary mallctl entries.
| * Remove unnecessary zeroing in arena_palloc().Jason Evans2013-10-302-48/+79
| |
| * Update autoconf support files.Jason Evans2013-10-282-123/+171
| |
| * Fix whitespace.Jason Evans2013-10-281-1/+1
| |
| * Add support for LinuxThreads.Leonard Crestez2013-10-252-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using LinuxThreads pthread_setspecific triggers recursive allocation on all threads. Work around this by creating a global linked list of in-progress tsd initializations. This modifies the _tsd_get_wrapper macro-generated function. When it has to initialize an TSD object it will push the item to the linked list first. If this causes a recursive allocation then the _get_wrapper request is satisfied from the list. When pthread_setspecific returns the item is removed from the list. This effectively adds a very poor substitute for real TLS used only during pthread_setspecific allocation recursion. Signed-off-by: Crestez Dan Leonard <lcrestez@ixiacom.com>
| * Delay pthread_atfork registering.Leonard Crestez2013-10-241-12/+18
| | | | | | | | | | | | This function causes recursive allocation on LinuxThreads. Signed-off-by: Crestez Dan Leonard <lcrestez@ixiacom.com>
| * Fix a file descriptor leak in a prof_dump_maps() error path.Jason Evans2013-10-211-8/+19
| | | | | | | | Reported by Pat Lynch.
| * Add a missing mutex unlock in malloc_init_hard() error path.Jason Evans2013-10-211-1/+3
| | | | | | | | | | | | | | | | Add a missing mutex unlock in a malloc_init_hard() error path (failed mutex initialization). In practice this bug was very unlikely to ever trigger, but if it did, application deadlock would likely result. Reported by Pat Lynch.
| * Avoid (x < 0) comparison for unsigned x.Jason Evans2013-10-211-2/+3
| | | | | | | | | | | | | | Avoid (min < 0) comparison for unsigned min in malloc_conf_init(). This bug had no practical consequences. Reported by Pat Lynch.
| * Fix a data race for large allocation stats counters.Jason Evans2013-10-211-1/+4
| | | | | | | | Reported by Pat Lynch.
| * Consistently use malloc_mutex_prefork().Jason Evans2013-10-213-5/+5
| | | | | | | | | | Consistently use malloc_mutex_prefork() instead of malloc_mutex_lock() in all prefork functions.
| * Prefer not_reached() over assert(false) where appropriate.Jason Evans2013-10-215-13/+12
|/
* Merge branch 'dev'3.4.1Jason Evans2013-10-2116-113/+206
|\