summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Fix an off-by-one flaw in a test.Jason Evans2013-10-201-1/+2
|
* Fix dangerous casts in tests.Jason Evans2013-10-203-6/+10
| | | | | | Fix dangerous casts of int variables to pointers in thread join function calls. On LP64 systems, int and pointers are different sizes, so writes can corrupt memory.
* Fix Valgrind integration.Jason Evans2013-02-012-0/+2
| | | | | Fix Valgrind integration to annotate all internally allocated memory in a way that keeps Valgrind happy about internal data structure access.
* Add arena-specific and selective dss allocation.Jason Evans2012-10-133-3/+73
| | | | | | | | | | | | | | | | | | | Add the "arenas.extend" mallctl, so that it is possible to create new arenas that are outside the set that jemalloc automatically multiplexes threads onto. Add the ALLOCM_ARENA() flag for {,r,d}allocm(), so that it is possible to explicitly allocate from a particular arena. Add the "opt.dss" mallctl, which controls the default precedence of dss allocation relative to mmap allocation. Add the "arena.<i>.dss" mallctl, which makes it possible to set the default dss precedence on a per arena or global basis. Add the "arena.<i>.purge" mallctl, which obsoletes "arenas.purge". Add the "stats.arenas.<i>.dss" mallctl.
* Use Get/SetLastError on Win32Mike Hommey2012-04-301-11/+14
| | | | | | | | | Using errno on win32 doesn't quite work, because the value set in a shared library can't be read from e.g. an executable calling the function setting errno. At the same time, since buferror always uses errno/GetLastError, don't pass it.
* Avoid variable length arrays and remove declarations within codeMike Hommey2012-04-291-4/+12
| | | | | | | | | | | | MSVC doesn't support C99, and building as C++ to be able to use them is dangerous, as C++ and C99 are incompatible. Introduce a VARIABLE_ARRAY macro that either uses VLA when supported, or alloca() otherwise. Note that using alloca() inside loops doesn't quite work like VLAs, thus the use of VARIABLE_ARRAY there is discouraged. It might be worth investigating ways to check whether VARIABLE_ARRAY is used in such context at runtime in debug builds and bail out if that happens.
* Remove #includes in testsMike Hommey2012-04-229-55/+0
| | | | | | | Since we're now including jemalloc_internal.h, all the required headers are already pulled. This will avoid having to fiddle with headers that can or can't be used with MSVC. Also, now that we use malloc_printf, we can use util.h's definition of assert instead of assert.h's.
* Add support for MingwMike Hommey2012-04-222-0/+30
|
* Add an abstraction layer for threading in testsMike Hommey2012-04-184-55/+45
|
* Replace fprintf with malloc_printf in tests.Mike Hommey2012-04-1710-106/+101
|
* Rename labels.Jason Evans2012-04-104-22/+22
| | | | | | | Rename labels from FOO to label_foo in order to avoid system macro definitions, in particular OUT and ERROR on mingw. Reported by Mike Hommey.
* Revert "Avoid NULL check in free() and malloc_usable_size()."Jason Evans2012-04-022-21/+0
| | | | | | | | | | This reverts commit 96d4120ac08db3f2d566e8e5c3bc134a24aa0afc. ivsalloc() depends on chunks_rtree being initialized. This can be worked around via a NULL pointer check. However, thread_allocated_tsd_get() also depends on initialization having occurred, and there is no way to guard its call in free() that is cheaper than checking whether ptr is NULL.
* Avoid NULL check in free() and malloc_usable_size().Jason Evans2012-04-022-0/+21
| | | | | | | | | Generalize isalloc() to handle NULL pointers in such a way that the NULL checking overhead is only paid when introspecting huge allocations (or NULL). This allows free() and malloc_usable_size() to no longer check for NULL. Submitted by Igor Bukanov and Mike Hommey.
* Add the "thread.tcache.enabled" mallctl.Jason Evans2012-03-272-0/+111
|
* Implement aligned_alloc().Jason Evans2012-03-132-0/+148
| | | | | | | | 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.
* Implement malloc_vsnprintf().Jason Evans2012-03-082-8/+8
| | | | | | | | | | | | 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.
* Use UINT64_C() rather than LLU for 64-bit constants.Jason Evans2012-03-052-17/+18
|
* Add --with-mangling.Jason Evans2012-03-026-60/+54
| | | | | | | | | | 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-291-13/+78
| | | | | | | 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.
* Fix rallocm() test to support >4KiB pages.Jason Evans2011-11-061-4/+14
|
* Move repo contents in jemalloc/ to top level.Jason Evans2011-04-0115-0/+895