summaryrefslogtreecommitdiffstats
path: root/test/src
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of most of the various inline macros.David Goldblatt2017-04-241-37/+37
|
* Add basic reentrancy-checking support, and allow arena_new to reenter.David Goldblatt2017-04-071-24/+52
| | | | | | | | | This checks whether or not we're reentrant using thread-local data, and, if we are, moves certain internal allocations to use arena 0 (which should be properly initialized after bootstrapping). The immediate thing this allows is spinning up threads in arena_new, which will enable spinning up background threads there.
* Add hooking functionalityDavid Goldblatt2017-04-071-4/+72
| | | | | This allows us to hook chosen functions and do interesting things there (in particular: reentrancy checking).
* Replace tabs following #define with spaces.Jason Evans2017-01-213-3/+3
| | | | This resolves #564.
* Remove extraneous parens around return arguments.Jason Evans2017-01-214-10/+10
| | | | This resolves #540.
* Update brace style.Jason Evans2017-01-216-53/+38
| | | | | | | Add braces around single-line blocks, and remove line breaks before function-opening braces. This resolves #537.
* Remove leading blank lines from function bodies.Jason Evans2017-01-136-15/+0
| | | | This resolves #535.
* Add os_unfair_lock support.Jason Evans2016-11-031-0/+7
| | | | | OS X 10.12 deprecated OSSpinLock; os_unfair_lock is the recommended replacement.
* Fix tsd bootstrapping for a0malloc().Jason Evans2016-05-071-15/+41
|
* Refactor out signed/unsigned comparisons.Jason Evans2016-03-151-3/+2
|
* Refactor time_* into nstime_*.Jason Evans2016-02-221-8/+8
| | | | | | | Use a single uint64_t in nstime_t to store nanoseconds rather than using struct timespec. This reduces fragility around conversions between long and uint64_t, especially missing casts that only cause problems on 32-bit platforms.
* Flesh out time_*() API.Jason Evans2016-02-201-32/+8
|
* Fix MinGW-related portability issues.Jason Evans2015-07-231-2/+2
| | | | | | | | | | | | | 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-221-2/+2
| | | | | | 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-211-0/+27
|
* Add timer support for Windows.Jason Evans2015-07-131-7/+18
|
* use CLOCK_MONOTONIC in the timer if it's availableDaniel Micay2015-03-131-0/+17
| | | | | | Linux sets _POSIX_MONOTONIC_CLOCK to 0 meaning it *might* be available, so a sysconf check is necessary at runtime with a fallback to the mandatory CLOCK_REALTIME clock.
* Refactor permuted backtrace test allocation.Jason Evans2014-10-023-0/+14
| | | | | | Refactor permuted backtrace test allocation that was originally used only by the prof_accum test, so that it can be used by other heap profiling test binaries.
* avoid conflict with the POSIX timer_t typeDaniel Micay2014-09-081-4/+4
| | | | It hits a compilation error with glibc 2.19 without a rename.
* Add a simple timer implementation for use in benchmarking.Jason Evans2014-09-081-0/+57
|
* Whitespace cleanups.Jason Evans2014-09-051-10/+10
|
* Fix thd_join on win64Mike Hommey2014-06-021-2/+5
|
* Use KQU() rather than QU() where applicable.Jason Evans2014-05-291-1/+1
| | | | Fix KZI() and KQI() to append LL rather than ULL.
* Use nallocx() rather than mallctl() to trigger initialization.Jason Evans2014-05-281-1/+1
| | | | | | Use nallocx() rather than mallctl() to trigger initialization, because nallocx() has no side effects other than initialization, whereas mallctl() does a bunch of internal memory allocation.
* Make sure initialization occurs prior to running tests.Jason Evans2014-05-281-1/+14
|
* Correctly return exit code from thd_join on WindowsMike Hommey2014-05-281-1/+2
|
* Use ULL prefix instead of LLU for unsigned long longsMike Hommey2014-05-271-1/+1
| | | | MSVC only supports the former.
* Define _CRT_SPINCOUNT in test/src/mtx.c like in src/mutex.cMike Hommey2014-05-271-0/+4
|
* Fix coding sytle nits.Jason Evans2014-05-011-2/+2
|
* Enable big-endian mode for SFMT.Jason Evans2014-03-311-0/+3
| | | | | Add cpp logic to enable big-endian mode in SFMT. This should fix SFMT tests on e.g. MIPS and SPARC.
* Fix p_test_fail()'s va_list abuse.Jason Evans2014-03-301-8/+2
| | | | | | | | | p_test_fail() was passing a va_list to two separate functions with the expectation that no reset would occur. Refactor p_test_fail()'s callers to instead format two strings and pass them to p_test_fail(). Add a missing parameter to an assert_u64_eq() call, which the compiler warned about after the assertion macro refactoring.
* Add zero/align tests for rallocx().Jason Evans2013-12-151-0/+2
|
* 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-121-5/+7
|
* Add mq (message queue) to test infrastructure.Jason Evans2013-12-123-35/+97
| | | | | | | | | 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.
* Fix inline-related macro issues.Jason Evans2013-12-101-19/+19
| | | | | | | | | 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.
* Add probabability distribution utility code.Jason Evans2013-12-102-5/+2
| | | | | | | | | | | | | | | 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-091-0/+717
| | | | | | | | | | | | 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.
* Refactor tests.Jason Evans2013-12-091-6/+74
| | | | | | | 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.
* Refactor to support more varied testing.Jason Evans2013-12-042-0/+63
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.