fb795867f0b3aa28bbdf177e1026f3e3408e0338 |
14-Nov-2014 |
Christopher Ferris <cferris@google.com> |
Tune the jemalloc to reign in PSS. The tcache in jemalloc can take up quite a bit of extra PSS. Disabling the tcache can save a lot of PSS, but it radically reduces performance. Tune the number of small and large values to store in the tcache. Immediately force any dirty pages to be purged, rather than keep some number of dirty pages around. Restore the chunk size back to 4MB. Using this chunk size and the force dirty page results in a higher cf-bench native mallocs score but about the same amount of PSS use. Limit the number of arenas to 2. The default is 2 * number of cpus, but that increases the amount of PSS used. My benchmarking indicates that more than 2 really doesn't help too much even on a device with 4 cpus. Nearly all speed-ups come from the tcache. Bug: 17498287 Change-Id: I23b23dd88288c90e002a0a04684fb06dbf4ee742
emalloc/internal/chunk.h
emalloc/internal/tcache.h
|
3f4f871a68c0b8150fcb66a0c4466bb595bc583a |
17-Sep-2014 |
Christopher Ferris <cferris@google.com> |
Merge "Do not munmap dead pages." into lmp-dev
|
ef19c12ffa052a654e6fb9b51be26923804950c6 |
16-Sep-2014 |
Christopher Ferris <cferris@google.com> |
Do not munmap dead pages. This causes perf problems since we spend a lot of time munmapping pages. The code already madvises away pages that are not in use. Bug: 17524229 Change-Id: I49174a675b17137a9f37254fe4cc5b4b5e7012f2
emalloc/internal/jemalloc_internal_defs.h
|
65ce8f311ec0f6055287dfee04d2d812f40d9e89 |
30-Jul-2014 |
Christopher Ferris <cferris@google.com> |
Decrease default chunk size from 4MB to 1MB. This will lower the amount of wasted memory on processes that do not allocate a lot of memory. (cherry picked from commit 161ffd9daef31bb142f242fc83bd58662e07981f) Change-Id: Idfb2d53119e468630c67a53c63b2a2742874dc8c
emalloc/internal/chunk.h
|
88ac2003d244fd0111179e9ea33ba4131df6809d |
15-Jul-2014 |
Christopher Ferris <cferris@google.com> |
Make sure je_XX functions are not exposed. Also fix other android specific code to use __ANDROID__. (cherry picked from commit 9bed7a48e337e2cd7a7dc22e7067204335031c15) Change-Id: Ie69b69a48178499c8b03940bc9b6c3eaec21cf3c
emalloc/jemalloc.h
|
9ebe2acb722ad8e29179cfbff35547f607e0f532 |
01-Jul-2014 |
Christopher Ferris <cferris@google.com> |
Update header files from new jemalloc changes. Also, fix gitignore, not to ignore generated headers. Change-Id: I6c781ae85112c2098d6808adba55c0c8e05e5ecc
emalloc/internal/jemalloc_internal.h
emalloc/internal/jemalloc_internal_defs.h
emalloc/internal/private_namespace.h
emalloc/internal/private_unnamespace.h
emalloc/internal/size_classes.h
emalloc/jemalloc.h
emalloc/jemalloc_mangle_jet.h
emalloc/jemalloc_protos.h
emalloc/jemalloc_protos_jet.h
|
5b8106e848d99433f62310dbf3cb80ef9812e572 |
12-Jun-2014 |
Mike Hommey <mh@glandium.org> |
Allow to build with clang-cl
svc_compat/C99/stdbool.h
|
3c95843a29457b90081423fb2a59f237ad086915 |
03-Jun-2014 |
Richard Diamond <wichard@vitalitystudios.com> |
Add check for madvise(2) to configure.ac. Some platforms, such as Google's Portable Native Client, use Newlib and thus lack access to madvise(2). In those instances, pages_purge() is transformed into a no-op.
emalloc/internal/jemalloc_internal_defs.h.in
|
2aa7fed9c983d8dcde7c0cacf1b024c966758b88 |
29-May-2014 |
Richard Diamond <wichard@vitalitystudios.com> |
Try to use __builtin_ffsl if ffsl is unavailable. Some platforms (like those using Newlib) don't have ffs/ffsl. This commit adds a check to configure.ac for __builtin_ffsl if ffsl isn't found. __builtin_ffsl performs the same function as ffsl, and has the added benefit of being available on any platform utilizing Gcc-compatible compiler. This change does not address the used of ffs in the MALLOCX_ARENA() macro.
emalloc/internal/arena.h
emalloc/internal/bitmap.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/jemalloc_internal_decls.h
emalloc/internal/jemalloc_internal_defs.h.in
emalloc/internal/util.h
|
15cb17e8aad6afb887ec15c162f357695658bdf6 |
02-Jun-2014 |
Jason Evans <jasone@canonware.com> |
Fix fallback lg_floor() implementations.
emalloc/internal/util.h
|
c2bc2a423846855e80ac313c23ef4b9c7a66c426 |
29-May-2014 |
Mike Hommey <mh@glandium.org> |
Don't use msvc_compat's C99 headers with MSVC versions that have (some) C99 support
svc_compat/C99/inttypes.h
svc_compat/C99/stdbool.h
svc_compat/C99/stdint.h
svc_compat/inttypes.h
svc_compat/stdbool.h
svc_compat/stdint.h
|
da74e77beefbc6ea0f9d7dbf663bc5df48fbd887 |
29-May-2014 |
Jason Evans <je@fb.com> |
Use KQU() rather than QU() where applicable. Fix KZI() and KQI() to append LL rather than ULL.
emalloc/internal/hash.h
emalloc/internal/jemalloc_internal_macros.h
|
8d8f9aeeaa77514d5732db5bd0111232af21fcfd |
29-May-2014 |
Jason Evans <je@fb.com> |
Add size class computation capability. Add size class computation capability, currently used only as validation of the size class lookup tables. Generalize the size class spacing used for bins, for eventual use throughout the full range of allocation sizes.
emalloc/internal/arena.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/jemalloc_internal_defs.h.in
emalloc/internal/jemalloc_internal_macros.h
emalloc/internal/private_symbols.txt
emalloc/internal/size_classes.sh
emalloc/internal/util.h
|
f3e6d15d74194c37c72990d5b3d216f90fda5a46 |
27-May-2014 |
Mike Hommey <mh@glandium.org> |
Move platform headers and tricks from jemalloc_internal.h.in to a new jemalloc_internal_decls.h header
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/jemalloc_internal_decls.h
emalloc/internal/jemalloc_internal_macros.h
|
50544e64a7c24f6d58a189026486672731d4d6d9 |
21-May-2014 |
Mike Hommey <mh@glandium.org> |
Move __func__ to jemalloc_internal_macros.h test/integration/aligned_alloc.c needs it.
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/jemalloc_internal_macros.h
|
8f4d78defb449d2c8432ad5edc5f3d1af3239065 |
21-May-2014 |
Mike Hommey <mh@glandium.org> |
Use ULL prefix instead of LLU for unsigned long longs MSVC only supports the former.
emalloc/internal/hash.h
|
12141150fdbda57651a53ae2fe0edaea4891d814 |
16-May-2014 |
Jason Evans <je@fb.com> |
Refactor huge allocation to be managed by arenas. Refactor huge allocation to be managed by arenas (though the global red-black tree of huge allocations remains for lookup during deallocation). This is the logical conclusion of recent changes that 1) made per arena dss precedence apply to huge allocation, and 2) made it possible to replace the per arena chunk allocation/deallocation functions. Remove the top level huge stats, and replace them with per arena huge stats. Normalize function names and types to *dalloc* (some were *dealloc*). Remove the --enable-mremap option. As jemalloc currently operates, this is a performace regression for some applications, but planned work to logarithmically space huge size classes should provide similar amortized performance. The motivation for this change was that mremap-based huge reallocation forced leaky abstractions that prevented refactoring.
emalloc/internal/arena.h
emalloc/internal/base.h
emalloc/internal/chunk.h
emalloc/internal/chunk_mmap.h
emalloc/internal/ctl.h
emalloc/internal/huge.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/jemalloc_internal_defs.h.in
emalloc/internal/private_symbols.txt
emalloc/internal/stats.h
emalloc/jemalloc_protos.h.in
|
59113bcc94b9fc7549611afb99ca99cad1a7f196 |
06-May-2014 |
aravind <aravind@fb.com> |
Add support for user-specified chunk allocators/deallocators. Add new mallctl endpoints "arena<i>.chunk.alloc" and "arena<i>.chunk.dealloc" to allow userspace to configure jemalloc's chunk allocator and deallocator on a per-arena basis.
emalloc/internal/arena.h
emalloc/internal/chunk.h
emalloc/internal/extent.h
emalloc/internal/huge.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_symbols.txt
emalloc/jemalloc_protos.h.in
|
73b37a9697acd53496bbef06ed25696e0c897341 |
23-Apr-2014 |
Jason Evans <jasone@canonware.com> |
Simplify backtracing. Simplify backtracing to not ignore any frames, and compensate for this in pprof in order to increase flexibility with respect to function-based refactoring even in the presence of non-deterministic inlining. Modify pprof to blacklist all jemalloc allocation entry points including non-standard ones like mallocx(), and ignore all allocator-internal frames. Prior to this change, pprof excluded the specifically blacklisted functions from backtraces, but it left allocator-internal frames intact.
emalloc/internal/prof.h
|
3716407897bd1273da21b0987fd8184f86623626 |
22-Apr-2014 |
Lucian Adrian Grijincu <lucian@fb.com> |
prof_backtrace: use unw_backtrace unw_backtrace: - does internal per-thread caching - doesn't acquire an internal lock
emalloc/internal/jemalloc_internal.h.in
|
5daf4e4a8d52ac2d5b40b0d12ce5721c6b9676e7 |
23-Apr-2014 |
Christopher Ferris <cferris@google.com> |
Initial commit. This change allows jemalloc to compile for all known targets. Bug: 981363 Change-Id: I847f653daa8430ae8fba90c8365aa0d11f7a4897
emalloc/internal/jemalloc_internal.h
emalloc/internal/jemalloc_internal_defs.h
emalloc/internal/private_namespace.h
emalloc/internal/private_unnamespace.h
emalloc/internal/public_namespace.h
emalloc/internal/public_symbols.txt
emalloc/internal/public_unnamespace.h
emalloc/internal/size_classes.h
emalloc/jemalloc.h
emalloc/jemalloc_defs.h
emalloc/jemalloc_macros.h
emalloc/jemalloc_mangle.h
emalloc/jemalloc_protos.h
emalloc/jemalloc_rename.h
|
3541a904d6fb949f3f0aea05418ccce7cbd4b705 |
17-Apr-2014 |
Jason Evans <je@fb.com> |
Refactor small_size2bin and small_bin2size. Refactor small_size2bin and small_bin2size to be inline functions rather than directly accessed arrays.
emalloc/internal/arena.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_symbols.txt
emalloc/internal/tcache.h
|
0b49403958b68294eee0eca8a0b5195e761cf316 |
17-Apr-2014 |
Jason Evans <je@fb.com> |
Fix debug-only compilation failures. Fix debug-only compilation failures introduced by changes to prof_sample_accum_update() in: 6c39f9e059d0825f4c29d8cec9f318b798912c3c refactor profiling. only use a bytes till next sample variable.
emalloc/internal/prof.h
|
3e3caf03af6ca579e473ace4daf25f63102aca4f |
17-Apr-2014 |
Jason Evans <jasone@canonware.com> |
Merge pull request #73 from bmaurer/smallmalloc Smaller malloc hot path
|
021136ce4db79f50031a1fd5dd751891888fbc7b |
16-Apr-2014 |
Ben Maurer <bmaurer@fb.com> |
Create a const array with only a small bin to size map
emalloc/internal/arena.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_symbols.txt
emalloc/internal/tcache.h
|
6c39f9e059d0825f4c29d8cec9f318b798912c3c |
15-Apr-2014 |
Ben Maurer <bmaurer@fb.com> |
refactor profiling. only use a bytes till next sample variable.
emalloc/internal/private_symbols.txt
emalloc/internal/prof.h
|
a7619b7fa56f98d1ca99a23b458696dd37c12b77 |
15-Apr-2014 |
Ben Maurer <bmaurer@fb.com> |
outline rare tcache_get codepaths
emalloc/internal/private_symbols.txt
emalloc/internal/tcache.h
|
bd87b01999416ec7418ff8bdb504d9b6c009ff68 |
16-Apr-2014 |
Jason Evans <je@fb.com> |
Optimize Valgrind integration. Forcefully disable tcache if running inside Valgrind, and remove Valgrind calls in tcache-specific code. Restructure Valgrind-related code to move most Valgrind calls out of the fast path functions. Take advantage of static knowledge to elide some branches in JEMALLOC_VALGRIND_REALLOC().
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_symbols.txt
emalloc/internal/tcache.h
emalloc/internal/valgrind.h
|
ecd3e59ca351d7111ec72a327fe0c009f2aa69a0 |
15-Apr-2014 |
Jason Evans <je@fb.com> |
Remove the "opt.valgrind" mallctl. Remove the "opt.valgrind" mallctl because it is unnecessary -- jemalloc automatically detects whether it is running inside valgrind.
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_symbols.txt
|
4d434adb146375ad17f0d5e994ed5728d2942e3f |
15-Apr-2014 |
Jason Evans <je@fb.com> |
Make dss non-optional, and fix an "arena.<i>.dss" mallctl bug. Make dss non-optional on all platforms which support sbrk(2). Fix the "arena.<i>.dss" mallctl to return an error if "primary" or "secondary" precedence is specified, but sbrk(2) is not supported.
emalloc/internal/arena.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/jemalloc_internal_defs.h.in
|
9790b9667fd975b1f9a4f108f9d0a20ab265c6b6 |
15-Apr-2014 |
Jason Evans <jasone@canonware.com> |
Remove the *allocm() API, which is superceded by the *allocx() API.
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_symbols.txt
emalloc/jemalloc_defs.h.in
emalloc/jemalloc_macros.h.in
emalloc/jemalloc_protos.h.in
|
9b0cbf0850b130a9b0a8c58bd10b2926b2083510 |
11-Apr-2014 |
Jason Evans <je@fb.com> |
Remove support for non-prof-promote heap profiling metadata. Make promotion of sampled small objects to large objects mandatory, so that profiling metadata can always be stored in the chunk map, rather than requiring one pointer per small region in each small-region page run. In practice the non-prof-promote code was only useful when using jemalloc to track all objects and report them as leaks at program exit. However, Valgrind is at least as good a tool for this particular use case. Furthermore, the non-prof-promote code is getting in the way of some optimizations that will make heap profiling much cheaper for the predominant use case (sampling a small representative proportion of all allocations).
emalloc/internal/arena.h
emalloc/internal/private_symbols.txt
emalloc/internal/prof.h
emalloc/internal/size_classes.sh
emalloc/internal/tcache.h
|
be8e59f5a64ef775c9694aee0d6a87d92336d303 |
06-Apr-2014 |
Ben Maurer <bmaurer@fb.com> |
Don't dereference chunk->arena in free() hot path When you call free() we load chunk->arena even though that data isn't used on the tcache hot path. In profiling some FB applications, I found that ~30% of the dTLB misses in the free() function come from this line. With 4 MB chunks, the arena_chunk_t->map is ~ 32 KB (1024 pages in the chunk, 4 8 byte pointers in arena_chunk_map_t). This means there's only a 1/8 chance of the page containing chunk->arena also comtaining the map bits.
emalloc/internal/arena.h
emalloc/internal/jemalloc_internal.h.in
|
8a26eaca7f4c95771ecbf096caeeba14fbe1122f |
31-Mar-2014 |
Jason Evans <jasone@canonware.com> |
Add private namespace mangling for huge_dss_prec_get().
emalloc/internal/private_symbols.txt
|
df3f27024f193b7baeedcd9f3799b4774dd20bbf |
31-Mar-2014 |
Jason Evans <jasone@canonware.com> |
Adapt hash tests to big-endian systems. The hash code, which has MurmurHash3 at its core, generates different output depending on system endianness, so adapt the expected output on big-endian systems. MurmurHash3 code also makes the assumption that unaligned access is okay (not true on all systems), but jemalloc only hashes data structures that have sufficient alignment to dodge this limitation.
emalloc/internal/hash.h
emalloc/internal/jemalloc_internal_defs.h.in
|
fbb31029a5c2f556f39e04a8781340d4ee4cf16c |
27-Mar-2014 |
Max Wang <mwang@fb.com> |
Use arena dss prec instead of default for huge allocs. Pass a dss_prec_t parameter to huge_{m,p,r}alloc instead of defaulting to the chunk dss prec.
emalloc/internal/huge.h
emalloc/internal/jemalloc_internal.h.in
|
99b0fbbe6975bf2af1387f75d961ad84fb108276 |
25-Feb-2014 |
Jason Evans <jasone@canonware.com> |
Add workaround for missing 'restrict' keyword. Add a cpp #define that removes 'restrict' keyword usage unless the compiler definitely supports C99. As written, 'restrict' is only enabled if the compiler supports the -std=gnu99 option (e.g. gcc and llvm). Reported by Tobias Hieta.
emalloc/internal/jemalloc_internal_defs.h.in
emalloc/internal/jemalloc_internal_macros.h
|
5f60afa01eb2cf7d44024d162a1ecc6cceedcca1 |
29-Jan-2014 |
Jason Evans <jasone@canonware.com> |
Avoid a compiler warning. Avoid copying "jeprof" to a 1-byte buffer within prof_boot0() when heap profiling is disabled. Although this is dead code under such conditions, the compiler doesn't figure that part out. Reported by Eduardo Silva.
emalloc/internal/prof.h
|
0dec3507c62efac909e204217bf9b6c8c59d10ac |
22-Jan-2014 |
Jason Evans <jasone@canonware.com> |
Remove __FBSDID from rb.h.
emalloc/internal/rb.h
|
772163b4f3d8e9a12343e9215f6b070068507604 |
18-Jan-2014 |
Jason Evans <je@fb.com> |
Add heap profiling tests. Fix a regression in prof_dump_ctx() due to an uninitized variable. This was caused by revision 4f37ef693e3d5903ce07dc0b61c0da320b35e3d9, so no releases are affected.
emalloc/internal/private_symbols.txt
emalloc/internal/prof.h
|
eefdd02e70ec1b9cf11920fcff585835dcbd766b |
17-Jan-2014 |
Jason Evans <je@fb.com> |
Fix a variable prototype/definition mismatch.
emalloc/internal/prof.h
|
f234dc51b9740242d8ba69307db7c5a1312f5a03 |
17-Jan-2014 |
Jason Evans <je@fb.com> |
Fix name mangling for stress tests. Fix stress tests such that testlib code uses the jet_ allocator, but test code uses libjemalloc. Generate jemalloc_{rename,mangle}.h, the former because it's needed for the stress test name mangling fix, and the latter for consistency. As an artifact of this change, some (but not all) definitions related to the experimental API are absent from the headers unless the feature is enabled at configure time.
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/public_namespace.sh
emalloc/internal/public_symbols.txt
emalloc/internal/public_unnamespace.sh
emalloc/jemalloc.sh
emalloc/jemalloc_defs.h.in
emalloc/jemalloc_mangle.h.in
emalloc/jemalloc_mangle.sh
emalloc/jemalloc_rename.sh
|
4f37ef693e3d5903ce07dc0b61c0da320b35e3d9 |
16-Jan-2014 |
Jason Evans <je@fb.com> |
Refactor prof_dump() to reduce contention. Refactor prof_dump() to use a two pass algorithm, and prof_leave() prior to the second pass. This avoids write(2) system calls while holding critical prof resources. Fix prof_dump() to close the dump file descriptor for all relevant error paths. Minimize the size of prof-related static buffers when prof is disabled. This saves roughly 65 KiB of application memory for non-prof builds. Refactor prof_ctx_init() out of prof_lookup_global().
emalloc/internal/prof.h
|
aa5113b1fdafd1129c22512837c6c3d66c295fc8 |
15-Jan-2014 |
Jason Evans <je@fb.com> |
Refactor overly large/complex functions. Refactor overly large functions by breaking out helper functions. Refactor overly complex multi-purpose functions into separate more specific functions.
emalloc/internal/arena.h
|
b2c31660be917ea6d59cd54e6f650b06b5e812ed |
13-Jan-2014 |
Jason Evans <je@fb.com> |
Extract profiling code from [re]allocation functions. Extract profiling code from malloc(), imemalign(), calloc(), realloc(), mallocx(), rallocx(), and xallocx(). This slightly reduces the amount of code compiled into the fast paths, but the primary benefit is the combinatorial complexity reduction. Simplify iralloc[t]() by creating a separate ixalloc() that handles the no-move cases. Further simplify [mrxn]allocx() (and by implication [mrn]allocm()) to make request size overflows due to size class and/or alignment constraints trigger undefined behavior (detected by debug-only assertions). Report ENOMEM rather than EINVAL if an OOM occurs during heap profiling backtrace creation in imemalign(). This bug impacted posix_memalign() and aligned_alloc().
emalloc/internal/arena.h
emalloc/internal/huge.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_symbols.txt
|
6b694c4d47278cddfaaedeb7ee49fa5757e35ed5 |
08-Jan-2014 |
Jason Evans <je@fb.com> |
Add junk/zero filling unit tests, and fix discovered bugs. Fix growing large reallocation to junk fill new space. Fix huge deallocation to junk fill when munmap is disabled.
emalloc/internal/arena.h
emalloc/internal/huge.h
emalloc/internal/private_symbols.txt
|
e18c25d23de0e845f0ee7e11d02c1be044738a3c |
07-Jan-2014 |
Jason Evans <je@fb.com> |
Add util unit tests, and fix discovered bugs. Add unit tests for pow2_ceil(), malloc_strtoumax(), and malloc_snprintf(). Fix numerous bugs in malloc_strotumax() error handling/reporting. These bugs could have caused application-visible issues for some seldom used (0X... and 0... prefixes) or malformed MALLOC_CONF or mallctl() argument strings, but otherwise they had no impact. Fix numerous bugs in malloc_snprintf(). These bugs were not exercised by existing malloc_*printf() calls, so they had no impact.
emalloc/internal/util.h
|
b954bc5d3a65966df0ce7801cd6102542b5e894b |
03-Jan-2014 |
Jason Evans <je@fb.com> |
Convert rtree from (void *) to (uint8_t) storage. Reduce rtree memory usage by storing booleans (1 byte each) rather than pointers. The rtree code is only used to record whether jemalloc manages a chunk of memory, so there's no need to store pointers in the rtree. Increase rtree node size to 64 KiB in order to reduce tree depth from 13 to 3 on 64-bit systems. The conversion to more compact leaf nodes was enough by itself to make the rtree depth 1 on 32-bit systems; due to the fact that root nodes are smaller than the specified node size if possible, the node size change has no impact on 32-bit systems (assuming default chunk size).
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/rtree.h
|
b980cc774a9ccb208a82f4e9ccdcc695d06a960a |
03-Jan-2014 |
Jason Evans <je@fb.com> |
Add rtree unit tests.
emalloc/internal/private_symbols.txt
emalloc/internal/rtree.h
|
1b75b4e6d11814f470e797be4a610a2e3ae323d5 |
18-Dec-2013 |
Jason Evans <jasone@canonware.com> |
Add missing prototypes.
emalloc/internal/hash.h
|
0d6c5d8bd0d866a0ce4ce321259cec65d6459821 |
18-Dec-2013 |
Jason Evans <jasone@canonware.com> |
Add quarantine unit tests. 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.
emalloc/internal/arena.h
emalloc/internal/private_symbols.txt
|
e6b7aa4a609d4b514d772ee4a1340778a195f6f7 |
17-Dec-2013 |
Jason Evans <jasone@canonware.com> |
Add hash (MurmurHash3) tests. Add hash tests that are based on SMHasher's VerificationTest() function.
emalloc/internal/hash.h
|
5fbad0902b845b1a6b311994468d0b9962e4fd30 |
16-Dec-2013 |
Jason Evans <jasone@canonware.com> |
Finish arena_prof_ctx_set() optimization. Delay reading the mapbits until it's unavoidable.
emalloc/internal/arena.h
|
6e62984ef6ca4312cf0a2e49ea2cc38feb94175b |
16-Dec-2013 |
Jason Evans <jasone@canonware.com> |
Don't junk-fill reallocations unless usize changes. 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.
emalloc/internal/tcache.h
|
665769357cd77b74e00a146f196fff19243b33c4 |
16-Dec-2013 |
Jason Evans <jasone@canonware.com> |
Optimize arena_prof_ctx_set(). 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.
emalloc/internal/arena.h
emalloc/internal/prof.h
|
34779914400988922d36815b7085893fbcc89a2e |
14-Dec-2013 |
Jason Evans <je@fb.com> |
Fix name mangling issues. 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.
emalloc/jemalloc_defs.h.in
emalloc/jemalloc_macros.h.in
|
d82a5e6a34f20698ab9368bb2b4953b81d175552 |
13-Dec-2013 |
Jason Evans <jasone@canonware.com> |
Implement the *allocx() API. 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);
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_symbols.txt
emalloc/internal/public_symbols.txt
emalloc/jemalloc_macros.h.in
emalloc/jemalloc_mangle.h.in
emalloc/jemalloc_protos.h.in
|
0f4f1efd94d33a4bbf766d3d4e7e349fa7c0d3b9 |
12-Dec-2013 |
Jason Evans <je@fb.com> |
Add mq (message queue) to test infrastructure. 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.
emalloc/internal/hash.h
emalloc/internal/jemalloc_internal_defs.h.in
emalloc/internal/tsd.h
|
6edc97db15311fdac189798ec24e3eb39dc75d8e |
10-Dec-2013 |
Jason Evans <je@fb.com> |
Fix inline-related macro issues. 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.
emalloc/internal/jemalloc_internal_macros.h
|
b1941c615023cab9baf0a78a28df1e3b4972434f |
10-Dec-2013 |
Jason Evans <jasone@canonware.com> |
Add probabability distribution utility code. 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.
emalloc/internal/jemalloc_internal_macros.h
emalloc/internal/prof.h
|
a4f124f59fa5f702231432a7e5fa45140ba81e2a |
09-Dec-2013 |
Jason Evans <jasone@canonware.com> |
Normalize #define whitespace. Consistently use a tab rather than a space following #define.
emalloc/internal/ckh.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/prng.h
emalloc/internal/ql.h
emalloc/internal/qr.h
emalloc/internal/tsd.h
emalloc/internal/util.h
|
2a83ed0284e92c7ba4bd4efe9df149ac724b2f26 |
09-Dec-2013 |
Jason Evans <jasone@canonware.com> |
Refactor tests. 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.
emalloc/internal/chunk_dss.h
emalloc/internal/util.h
|
9f35a71a81adcfd6c0ea6461ecd2b84ac384e34f |
07-Dec-2013 |
Jason Evans <jasone@canonware.com> |
Make jemalloc.h formatting more consistent.
emalloc/jemalloc.sh
emalloc/jemalloc_defs.h.in
emalloc/jemalloc_macros.h.in
emalloc/jemalloc_mangle.h.in
|
748dfac7788e3cbc2fc6d36196a81d3f002669f6 |
07-Dec-2013 |
Jason Evans <jasone@canonware.com> |
Add test code coverage analysis. Add test code coverage analysis based on gcov.
emalloc/internal/jemalloc_internal_defs.h.in
emalloc/internal/jemalloc_internal_macros.h
|
d37d5adee4e4570cfda83e5f1b948a25b9226224 |
06-Dec-2013 |
Jason Evans <jasone@canonware.com> |
Disable floating point code/linking when possible. 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.
emalloc/internal/prof.h
|
dc1bed62272045651e4bbf2cd85f6fccaf7b1331 |
06-Dec-2013 |
Jason Evans <je@fb.com> |
Fix more test refactoring issues.
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/jemalloc_internal_defs.h.in
emalloc/internal/jemalloc_internal_macros.h
emalloc/jemalloc.sh
emalloc/jemalloc_defs.h.in
emalloc/jemalloc_macros.h.in
|
14990b83d1dffe04638df0c09eb1a5c3b1118462 |
06-Dec-2013 |
Jason Evans <je@fb.com> |
Fix test refactoring issues for Linux.
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/jemalloc_internal_defs.h.in
|
86abd0dcd8e478759fe409d338d11558c4cec427 |
01-Dec-2013 |
Jason Evans <jasone@canonware.com> |
Refactor to support more varied testing. 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.
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/jemalloc_internal_defs.h.in
emalloc/internal/private_namespace.h
emalloc/internal/private_namespace.sh
emalloc/internal/private_symbols.txt
emalloc/internal/private_unnamespace.sh
emalloc/internal/public_namespace.sh
emalloc/internal/public_symbols.txt
emalloc/internal/public_unnamespace.sh
emalloc/internal/util.h
emalloc/jemalloc.h.in
emalloc/jemalloc.sh
emalloc/jemalloc_defs.h.in
emalloc/jemalloc_macros.h.in
emalloc/jemalloc_mangle.h.in
emalloc/jemalloc_protos.h.in
|
c368f8c8a243248feb7771f4d32691e7b2aa6f1a |
30-Oct-2013 |
Jason Evans <je@fb.com> |
Remove unnecessary zeroing in arena_palloc().
emalloc/internal/arena.h
|
cb17fc6a8f1ce29be18de7af6d03e66056751fb2 |
21-Oct-2013 |
Leonard Crestez <lcrestez@ixiacom.com> |
Add support for LinuxThreads. 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>
emalloc/internal/tsd.h
|
6556e28be15d9acd8f3835fb9fad90145e1edbff |
21-Oct-2013 |
Jason Evans <je@fb.com> |
Prefer not_reached() over assert(false) where appropriate.
emalloc/internal/util.h
|
dda90f59e2b67903668a2799970f64df163e9ccf |
20-Oct-2013 |
Jason Evans <jasone@canonware.com> |
Fix a Valgrind integration flaw. Fix a Valgrind integration flaw that caused Valgrind warnings about reads of uninitialized memory in internal zero-initialized data structures (relevant to tcache and prof code).
emalloc/internal/tcache.h
|
87a02d2bb18dbcb2955541b849bc95862e864803 |
20-Oct-2013 |
Jason Evans <jasone@canonware.com> |
Fix a Valgrind integration flaw. Fix a Valgrind integration flaw that caused Valgrind warnings about reads of uninitialized memory in arena chunk headers.
emalloc/internal/arena.h
emalloc/internal/private_namespace.h
|
543abf7e6c7de06fe9654e91190b5c44a11b065e |
20-Oct-2013 |
Jason Evans <jasone@canonware.com> |
Fix inlining warning. Add the JEMALLOC_ALWAYS_INLINE_C macro and use it for always-inlined functions declared in .c files. This fixes a function attribute inconsistency for debug builds that resulted in (harmless) compiler warnings about functions not being inlinable. Reported by Ricardo Nabinger Sanchez.
emalloc/internal/jemalloc_internal.h.in
|
daf6d0446ce64fb563b7d96fda077e6406c602be |
18-Mar-2013 |
Riku Voipio <riku.voipio@linaro.org> |
Add aarch64 LG_QUANTUM size definition Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
emalloc/internal/jemalloc_internal.h.in
|
a4915851577c948cf9051d60152944ca2d1b2d59 |
06-Mar-2013 |
Jason Evans <je@fb.com> |
Add no-op bodies to VALGRIND_*() macro stubs. Add no-op bodies to VALGRIND_*() macro stubs so that they can be used in contexts like the following without generating a compiler warning about the 'if' statement having an empty body: if (config_valgrind) VALGRIND_MAKE_MEM_UNDEFINED(ret, size);
emalloc/internal/jemalloc_internal.h.in
|
9f9897ad4275e540cf1bea5a6de762c809b7695c |
28-Jan-2013 |
Mike Frysinger <vapier@gentoo.org> |
fix building for s390 systems Checking for __s390x__ means you work on s390x, but not s390 (32bit) systems. So use __s390__ which works for both. With this, `make check` passes on s390. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
emalloc/internal/jemalloc_internal.h.in
|
88c222c8e91499bf5d3fba53b24222df0cda5771 |
06-Feb-2013 |
Jason Evans <je@fb.com> |
Fix a prof-related locking order bug. Fix a locking order bug that could cause deadlock during fork if heap profiling were enabled.
emalloc/internal/arena.h
|
06912756cccd0064a9c5c59992dbac1cec68ba3f |
01-Feb-2013 |
Jason Evans <je@fb.com> |
Fix Valgrind integration. Fix Valgrind integration to annotate all internally allocated memory in a way that keeps Valgrind happy about internal data structure access.
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/tcache.h
|
bbe29d374d0fa5f4684621f16c099294e56c26ef |
31-Jan-2013 |
Jason Evans <je@fb.com> |
Fix potential TLS-related memory corruption. Avoid writing to uninitialized TLS as a side effect of deallocation. Initializing TLS during deallocation is unsafe because it is possible that a thread never did any allocation, and that TLS has already been deallocated by the threads library, resulting in write-after-free corruption. These fixes affect prof_tdata and quarantine; all other uses of TLS are already safe, whether intentionally (as for tcache) or unintentionally (as for arenas).
emalloc/internal/private_namespace.h
emalloc/internal/prof.h
emalloc/internal/quarantine.h
|
dd0438ee6b7b3640516d5a48feec1490ca2f1cc3 |
23-Jan-2013 |
Jason Evans <je@fb.com> |
Specify 'inline' in addition to always_inline attribute. Specify both inline and __attribute__((always_inline)), in order to avoid warnings when using newer versions of gcc.
emalloc/internal/jemalloc_internal.h.in
|
ae03bf6a57f0dd6a009288fa6477a300cabf6d5e |
22-Jan-2013 |
Jason Evans <jasone@canonware.com> |
Update hash from MurmurHash2 to MurmurHash3. Update hash from MurmurHash2 to MurmurHash3, primarily because the latter generates 128 bits in a single call for no extra cost, which simplifies integration with cuckoo hashing.
emalloc/internal/ckh.h
emalloc/internal/hash.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_namespace.h
|
88393cb0eb9a046000d20809809d4adac11957ab |
22-Jan-2013 |
Jason Evans <jasone@canonware.com> |
Add and use JEMALLOC_ALWAYS_INLINE. Add JEMALLOC_ALWAYS_INLINE and use it to guarantee that the entire fast paths of the primary allocation/deallocation functions are inlined.
emalloc/internal/arena.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/tcache.h
|
38067483c542adfe092644d1ecc103c6bc74add0 |
22-Jan-2013 |
Jason Evans <jasone@canonware.com> |
Tighten valgrind integration. Tighten valgrind integration such that immediately after memory is validated or zeroed, valgrind is told to forget the memory's 'defined' state. The only place newly allocated memory should be left marked as 'defined' is in the public functions (e.g. calloc() and realloc()).
emalloc/internal/tcache.h
|
13e4e24c42d17492f85cdd550c1e13d6f929307e |
03-Dec-2012 |
Garrett Cooper <yanegomi@gmail.com> |
Fix build break on *BSD Linux uses alloca.h; many other operating systems define alloca(3) in stdlib.h. Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
emalloc/internal/jemalloc_internal.h.in
emalloc/jemalloc_defs.h.in
|
a3b3386ddde8048b9d6b54c397bb93da5e806cef |
13-Nov-2012 |
Jason Evans <je@fb.com> |
Avoid arena_prof_accum()-related locking when possible. Refactor arena_prof_accum() and its callers to avoid arena locking when prof_interval is 0 (as when profiling is disabled). Reported by Ben Maurer.
emalloc/internal/arena.h
emalloc/internal/private_namespace.h
|
e3d13060c8a04f08764b16b003169eb205fa09eb |
30-Oct-2012 |
Jason Evans <je@fb.com> |
Purge unused dirty pages in a fragmentation-reducing order. Purge unused dirty pages in an order that first performs clean/dirty run defragmentation, in order to mitigate available run fragmentation. Remove the limitation that prevented purging unless at least one chunk worth of dirty pages had accumulated in an arena. This limitation was intended to avoid excessive purging for small applications, but the threshold was arbitrary, and the effect of questionable utility. Relax opt_lg_dirty_mult from 5 to 3. This compensates for increased likelihood of allocating clean runs, given the same ratio of clean:dirty runs, and reduces the potential for repeated purging in pathological large malloc/free loops that push the active:dirty page ratio just over the purge threshold.
emalloc/internal/arena.h
|
609ae595f0358157b19311b0f9f9591db7cee705 |
11-Oct-2012 |
Jason Evans <je@fb.com> |
Add arena-specific and selective dss allocation. 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.
emalloc/internal/arena.h
emalloc/internal/chunk.h
emalloc/internal/chunk_dss.h
emalloc/internal/ctl.h
emalloc/internal/huge.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_namespace.h
emalloc/jemalloc.h.in
|
247d1248478561c669a85d831e9758089f93a076 |
10-Oct-2012 |
Jason Evans <je@fb.com> |
Drop const from malloc_usable_size() argument on Linux. Drop const from malloc_usable_size() argument on Linux, in order to match the prototype in Linux's malloc.h.
emalloc/jemalloc.h.in
emalloc/jemalloc_defs.h.in
|
20f1fc95adb35ea63dc61f47f2b0ffbd37d39f32 |
09-Oct-2012 |
Jason Evans <je@fb.com> |
Fix fork(2)-related deadlocks. Add a library constructor for jemalloc that initializes the allocator. This fixes a race that could occur if threads were created by the main thread prior to any memory allocation, followed by fork(2), and then memory allocation in the child process. Fix the prefork/postfork functions to acquire/release the ctl, prof, and rtree mutexes. This fixes various fork() child process deadlocks, but one possible deadlock remains (intentionally) unaddressed: prof backtracing can acquire runtime library mutexes, so deadlock is still possible if heap profiling is enabled during fork(). This deadlock is known to be a real issue in at least the case of libgcc-based backtracing. Reported by tfengjun.
emalloc/internal/chunk.h
emalloc/internal/ctl.h
emalloc/internal/private_namespace.h
emalloc/internal/prof.h
emalloc/internal/rtree.h
|
7de92767c20cb72c94609b9c78985526fb84a679 |
09-Oct-2012 |
Jason Evans <je@fb.com> |
Fix mlockall()/madvise() interaction. mlockall(2) can cause purging via madvise(2) to fail. Fix purging code to check whether madvise() succeeded, and base zeroed page metadata on the result. Reported by Olivier Lecomte.
emalloc/internal/chunk_mmap.h
emalloc/internal/extent.h
|
dd03a2e37702b21fd692bf05d46ee9f97133ab78 |
09-Oct-2012 |
Jason Evans <jasone@canonware.com> |
Define LG_QUANTUM for hppa. Submitted by Jory Pratt.
emalloc/internal/jemalloc_internal.h.in
|
781fe75e0a03f13bc1f5403acbbf87796ceea1dc |
15-May-2012 |
Jason Evans <je@fb.com> |
Auto-detect whether running inside Valgrind. Auto-detect whether running inside Valgrind, thus removing the need to manually specify MALLOC_CONF=valgrind:true.
emalloc/internal/jemalloc_internal.h.in
|
3860eac17023933180ef5dfb5bd24077cda57dfe |
15-May-2012 |
Jason Evans <je@fb.com> |
Fix heap profiling crash for realloc(p, 0) case. Fix prof_realloc() to not call prof_ctx_set() if a sampled object is being freed via realloc(p, 0).
emalloc/internal/prof.h
|
d8ceef6c5558fdab8f9448376ae065a9e5ffcbdd |
11-May-2012 |
Jason Evans <jasone@canonware.com> |
Fix large calloc() zeroing bugs. Refactor code such that arena_mapbits_{large,small}_set() always preserves the unzeroed flag, and manually manipulate the unzeroed flag in the one case where it actually gets reset (in arena_chunk_purge()). This fixes unzeroed preservation bugs in arena_run_split() and arena_ralloc_large_grow(). These bugs caused large calloc() to return non-zeroed memory under some circumstances.
emalloc/internal/arena.h
|
53bd42c1fe35c25ea299b96d546a9d0089c6f78d |
10-May-2012 |
Jason Evans <je@fb.com> |
Update a comment.
emalloc/internal/arena.h
|
37b6f95dcd866f51c91488531a2efc3ed4c2b754 |
07-May-2012 |
Mike Hommey <mh@glandium.org> |
Export je_memalign and je_valloc da99e31 removed attributes on je_memalign and je_valloc, while they didn't have a definition in the jemalloc.h header, thus making them non-exported. Export them again, by defining them in the jemalloc.h header.
emalloc/jemalloc.h.in
|
2e671ffbadc02fc7de8cbafdd1031e3b0ad73c5b |
10-May-2012 |
Jason Evans <je@fb.com> |
Add the --enable-mremap option. Add the --enable-mremap option, and disable the use of mremap(2) by default, for the same reason that freeing chunks via munmap(2) is disabled by default on Linux: semi-permanent VM map fragmentation.
emalloc/internal/jemalloc_internal.h.in
emalloc/jemalloc_defs.h.in
|
1d01206bbc07a87ed8bf62d4d854ff3ff7dcae9a |
02-May-2012 |
Mike Hommey <mh@glandium.org> |
Use "standard" printf prefixes instead of MSVC ones in inttypes.h We don't use MSVC's printf, but ours, and it doesn't support the I32 and I64 prefixes.
svc_compat/inttypes.h
|
80737c3323dabc45232affcaeb99ac2bad6ea647 |
03-May-2012 |
Jason Evans <je@fb.com> |
Further optimize and harden arena_salloc(). Further optimize arena_salloc() to only look at the binind chunk map bits in the common case. Add more sanity checks to arena_salloc() that detect chunk map inconsistencies for large allocations (whether due to allocator bugs or application bugs).
emalloc/internal/arena.h
emalloc/internal/private_namespace.h
|
1b523da21c8aded36dbe669a9e9ca78c3c96cad7 |
02-May-2012 |
Jason Evans <jasone@canonware.com> |
Fix partial rename of s/EXPORT/JEMALLOC_EXPORT/g.
emalloc/jemalloc_defs.h.in
|
9a7944f8aba8806c2806c7bb4d61b1b6df59f044 |
02-May-2012 |
Jason Evans <jasone@canonware.com> |
Update private namespace mangling.
emalloc/internal/private_namespace.h
|
889ec59bd3ae3190fb715e64d8d15b6a1b47314a |
02-May-2012 |
Jason Evans <jasone@canonware.com> |
Make malloc_write() non-inline. Make malloc_write() non-inline, in order to resolve its dependency on je_malloc_write().
emalloc/internal/util.h
|
8d5865eb578e99369382d90bdd1e557e5b233277 |
02-May-2012 |
Jason Evans <je@fb.com> |
Make CACHELINE a raw constant. Make CACHELINE a raw constant in order to work around a __declspec(align()) limitation. Submitted by Mike Hommey.
emalloc/internal/jemalloc_internal.h.in
|
203484e2ea267e068a68fd2922263f0ff1d5ac6f |
02-May-2012 |
Jason Evans <je@fb.com> |
Optimize malloc() and free() fast paths. Embed the bin index for small page runs into the chunk page map, in order to omit [...] in the following dependent load sequence: ptr-->mapelm-->[run-->bin-->]bin_info Move various non-critcal code out of the inlined function chain into helper functions (tcache_event_hard(), arena_dalloc_small(), and locking).
emalloc/internal/arena.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_namespace.h
emalloc/internal/tcache.h
|
fd97b1dfc76647c3f90f28dc63cc987041fe20df |
30-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Add support for MSVC Tested with MSVC 8 32 and 64 bits.
emalloc/internal/atomic.h
emalloc/internal/jemalloc_internal.h.in
emalloc/jemalloc_defs.h.in
sc_compat/inttypes.h
sc_compat/stdint.h
svc_compat/inttypes.h
svc_compat/stdbool.h
svc_compat/stdint.h
svc_compat/strings.h
|
b45c57ecaf2bf7ff8abe013b856be90fb4e365f3 |
30-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Import msinttypes http://code.google.com/p/msinttypes/
sc_compat/inttypes.h
sc_compat/stdint.h
|
da99e31105eb709ef4ec8a120b115c32a6b9723a |
30-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Replace JEMALLOC_ATTR with various different macros when it makes sense Theses newly added macros will be used to implement the equivalent under MSVC. Also, move the definitions to headers, where they make more sense, and for some, are even more useful there (e.g. malloc).
emalloc/internal/util.h
emalloc/jemalloc.h.in
emalloc/jemalloc_defs.h.in
|
7cdea3973cab8640d1f44c7638ed5e30ed18be24 |
30-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Few configure.ac adjustments - Use the extensions autoconf finds for object and executable files. - Remove the sorev variable, and replace SOREV definition with sorev's. - Default to je_ prefix on win32.
emalloc/internal/util.h
|
a14bce85e885f83c96116cc5438ae52d740f3727 |
30-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Use Get/SetLastError on Win32 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.
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/util.h
|
8b49971d0ce0819af78aa2a278c26ecb298ee134 |
24-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Avoid variable length arrays and remove declarations within code 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.
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/prof.h
|
f27899402914065a6c1484ea8d81a2c8b70aa659 |
29-Apr-2012 |
Jason Evans <je@fb.com> |
Fix more prof_tdata resurrection corner cases.
emalloc/internal/prof.h
|
0050a0f7e6ea5a33c9aed769e2652afe20714194 |
29-Apr-2012 |
Jason Evans <je@fb.com> |
Handle prof_tdata resurrection. Handle prof_tdata resurrection during thread shutdown, similarly to how tcache and quarantine handle resurrection.
emalloc/internal/prof.h
|
3fb50b0407ff7dfe14727995706e2b42836f0f7e |
25-Apr-2012 |
Jason Evans <je@fb.com> |
Fix a PROF_ALLOC_PREP() error path. Fix a PROF_ALLOC_PREP() error path to initialize the return value to NULL.
emalloc/internal/prof.h
|
65f343a632aa1f6bd9b8a65761706391469d2620 |
24-Apr-2012 |
Jason Evans <je@fb.com> |
Fix ctl regression. Fix ctl to correctly compute the number of children at each level of the ctl tree.
emalloc/internal/ctl.h
|
461ad5c87ae5f89cd086e47b31372e9123dcfcdf |
20-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Avoid using a union for ctl_node_s MSVC doesn't support C99, and as such doesn't support designated initialization of structs and unions. As there is never a mix of indexed and named nodes, it is pretty straightforward to use a different type for each.
emalloc/internal/ctl.h
|
52386b2dc689db3bf71307424c4e1a2b7044c363 |
23-Apr-2012 |
Jason Evans <je@fb.com> |
Fix heap profiling bugs. Fix a potential deadlock that could occur during interval- and growth-triggered heap profile dumps. Fix an off-by-one heap profile statistics bug that could be observed in interval- and growth-triggered heap profiles. Fix heap profile dump filename sequence numbers (regression during conversion to malloc_snprintf()).
emalloc/internal/private_namespace.h
emalloc/internal/prof.h
|
a5288ca93434d98f91438de40d99177ffdfd2a17 |
20-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Remove unused #includes
emalloc/internal/jemalloc_internal.h.in
|
a19e87fbad020e8dd3d26682032929e8e5ae71c1 |
22-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Add support for Mingw
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/mutex.h
emalloc/internal/tsd.h
|
a8f8d7540d66ddee7337db80c92890916e1063ca |
22-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Remove mmap_unaligned. Remove mmap_unaligned, which was used to heuristically decide whether to optimistically call mmap() in such a way that could reduce the total number of system calls. If I remember correctly, the intention of mmap_unaligned was to avoid always executing the slow path in the presence of ASLR. However, that reasoning seems to have been based on a flawed understanding of how ASLR actually works. Although ASLR apparently causes mmap() to ignore address requests, it does not cause total placement randomness, so there is a reasonable expectation that iterative mmap() calls will start returning chunk-aligned mappings once the first chunk has been properly aligned.
emalloc/internal/chunk.h
emalloc/internal/chunk_mmap.h
emalloc/internal/private_namespace.h
|
7ad54c1c30e0805e0758690115875f982de46cf2 |
22-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Fix chunk allocation/deallocation bugs. Fix chunk_alloc_dss() to zero memory when requested. Fix chunk_dealloc() to avoid chunk_dealloc_mmap() for dss-allocated memory. Fix huge_palloc() to always junk fill when requested. Improve chunk_recycle() to report that memory is zeroed as a side effect of pages_purge().
emalloc/internal/tsd.h
|
8f0e0eb1c01d5d934586ea62e519ca8b8637aebc |
21-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Fix a memory corruption bug in chunk_alloc_dss(). Fix a memory corruption bug in chunk_alloc_dss() that was due to claiming newly allocated memory is zeroed. Reverse order of preference between mmap() and sbrk() to prefer mmap(). Clean up management of 'zero' parameter in chunk_alloc*().
emalloc/internal/chunk_mmap.h
|
bedceea2a8aef427d96a77762e9d4bda9f0cc0c3 |
20-Apr-2012 |
Jason Evans <je@fb.com> |
Fix isthreaded-related build breakage.
emalloc/internal/mutex.h
|
918d6e20b760da13776ca0faf8bc00b4647a482c |
20-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Add missing private namespace mangling.
emalloc/internal/private_namespace.h
|
7d20fbc44a28209e8b70e2d8efe12254962c6fd6 |
20-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Don't mangle pthread_create(). Don't mangle pthread_create(); it's an exported symbol when defined.
emalloc/internal/private_namespace.h
|
f7088e6c992d079bc3162e0c48ed4dc5def6d263 |
20-Apr-2012 |
Jason Evans <je@fb.com> |
Make arena_salloc() an inline function.
emalloc/internal/arena.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/tcache.h
|
13067ec8350f213c3accc2e5fb70ca5a503e0e17 |
18-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Remove extra argument for malloc_tsd_cleanup_register Bookkeeping an extra argument that actually only stores a function pointer for a function we already have is not very useful.
emalloc/internal/tsd.h
|
8ad483fe60a803acdbd403d88bb30b548ee1b5f9 |
18-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Remove initialization of the non-TLS tsd wrapper from static memory Using static memory when malloc_tsd_malloc fails means all threads share the same wrapper and thus the same wrapped value. This defeats the purpose of TSD.
emalloc/internal/tsd.h
|
7ff1ce4131651fea1df7b1c010d71667bc574816 |
18-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Initialize all members of non-TLS tsd wrapper when creating it Not setting the initialized member leads to randomly calling the cleanup function in cases it shouldn't be called (and isn't called in other implementations).
emalloc/internal/tsd.h
|
86e58583bb443fcfe885a1a96b466ab5933cb443 |
19-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Make special FreeBSD function overrides visible. Make special FreeBSD libc/libthr function overrides for _malloc_prefork(), _malloc_postfork(), and _malloc_thread_cleanup() visible.
emalloc/internal/private_namespace.h
|
666c5bf7a8baaa842da69cb402948411432a9d00 |
18-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Add a pages_purge function to wrap madvise(JEMALLOC_MADV_PURGE) calls This will be used to implement the feature on mingw, which doesn't have madvise.
emalloc/internal/chunk_mmap.h
emalloc/internal/private_namespace.h
emalloc/jemalloc_defs.h.in
|
0b25fe79aaf8840a5acda7e3160a053d42349872 |
18-Apr-2012 |
Jason Evans <je@fb.com> |
Update prof defaults to match common usage. Change the "opt.lg_prof_sample" default from 0 to 19 (1 B to 512 KiB). Change the "opt.prof_accum" default from true to false. Add the "opt.prof_final" mallctl, so that "opt.prof_prefix" need not be abused to disable final profile dumping.
emalloc/internal/prof.h
|
b57d3ec571c6551231be62b7bf92c084a8c8291c |
17-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Add atomic(9) implementations of atomic operations. Add atomic(9) implementations of atomic operations. These are used on FreeBSD for non-x86 architectures.
emalloc/internal/atomic.h
emalloc/internal/jemalloc_internal.h.in
emalloc/jemalloc_defs.h.in
|
45f208e112fcb82e0c98d572fc34259d65d6b6c1 |
16-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Replace fprintf with malloc_printf in tests.
emalloc/internal/jemalloc_internal.h.in
|
72ca7220f21ef32f17d12cfde1bd9732d56fb872 |
16-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Use echo instead of cat in loops in size_classes.sh This avoids fork/exec()ing in loops, as echo is a builtin, and makes size_classes.sh much faster (from > 10s to < 0.2s on mingw on my machine).
emalloc/internal/size_classes.sh
|
1dbfd5a209bed1a3d4bacaa31726a4179a4f1215 |
14-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Add/remove missing/cruft entries to/from private_namespace.h.
emalloc/internal/private_namespace.h
|
7ca0fdfb85b2a9fc7a112e158892c098e004385b |
13-Apr-2012 |
Jason Evans <je@fb.com> |
Disable munmap() if it causes VM map holes. Add a configure test to determine whether common mmap()/munmap() patterns cause VM map holes, and only use munmap() to discard unused chunks if the problem does not exist. Unify the chunk caching for mmap and dss. Fix options processing to limit lg_chunk to be large enough that redzones will always fit.
emalloc/internal/chunk_dss.h
emalloc/internal/chunk_mmap.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_namespace.h
emalloc/jemalloc_defs.h.in
|
83c324acd8bd5f32e0ce9b4d3df2f1a0ae46f487 |
12-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Use a stub replacement and disable dss when sbrk is not supported
emalloc/jemalloc_defs.h.in
|
5ff709c264e52651de25b788692c62ff1f6f389c |
12-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Normalize aligned allocation algorithms. Normalize arena_palloc(), chunk_alloc_mmap_slow(), and chunk_recycle_dss() to use the same algorithm for trimming over-allocation. Add the ALIGNMENT_ADDR2BASE(), ALIGNMENT_ADDR2OFFSET(), and ALIGNMENT_CEILING() macros, and use them where appropriate. Remove the run_size_p parameter from sa2u(). Fix a potential deadlock in chunk_recycle_dss() that was introduced by eae269036c9f702d9fa9be497a1a2aa1be13a29e (Add alignment support to chunk_alloc()).
emalloc/internal/arena.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_namespace.h
|
122449b073bcbaa504c4f592ea2d733503c272d2 |
06-Apr-2012 |
Jason Evans <je@fb.com> |
Implement Valgrind support, redzones, and quarantine. Implement Valgrind support, as well as the redzone and quarantine features, which help Valgrind detect memory errors. Redzones are only implemented for small objects because the changes necessary to support redzones around large and huge objects are complicated by in-place reallocation, to the point that it isn't clear that the maintenance burden is worth the incremental improvement to Valgrind support. Merge arena_salloc() and arena_salloc_demote(). Refactor i[v]salloc() to expose the 'demote' option.
emalloc/internal/arena.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_namespace.h
emalloc/internal/prof.h
emalloc/internal/quarantine.h
emalloc/internal/tcache.h
emalloc/internal/util.h
emalloc/jemalloc_defs.h.in
|
eae269036c9f702d9fa9be497a1a2aa1be13a29e |
10-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Add alignment support to chunk_alloc().
emalloc/internal/chunk.h
emalloc/internal/chunk_dss.h
emalloc/internal/chunk_mmap.h
|
c5851eaf6e0edb35a499d62d30199e336da5ccb6 |
10-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Remove MAP_NORESERVE support It was only used by the swap feature, and that is gone.
emalloc/internal/chunk_mmap.h
|
fad100bc35efba262f2c98cefc134899d393c734 |
06-Apr-2012 |
Jason Evans <je@fb.com> |
Remove arena_malloc_prechosen(). Remove arena_malloc_prechosen(), now that arena_malloc() can be invoked in a way that is semantically equivalent.
emalloc/internal/arena.h
|
b147611b5253921a873191bb0589d3b18f613946 |
05-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Add utrace(2)-based tracing (--enable-utrace).
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_namespace.h
emalloc/jemalloc_defs.h.in
|
bbe53b1c16d523d3c70cf8e942249f7d76f90e73 |
05-Apr-2012 |
Jason Evans <je@fb.com> |
Revert "Use ffsl() in ALLOCM_ALIGN()." This reverts commit 722b370399fd6734de6781285ce9a0cffd547bdd. Unfortunately, glibc requires _GNU_SOURCE to be defined before including string.h, but there is no reliable way to get the prototype within jemalloc.h unless _GNU_SOURCE was already defined.
emalloc/jemalloc.h.in
|
3cc1f1aa6981d6647aa01cec725fb2c134c1b0e9 |
04-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Add tls_model configuration. The tls_model attribute isn't supporte by clang (yet?), so add a configure test that defines JEMALLOC_TLS_MODEL appropriately.
emalloc/internal/tsd.h
emalloc/jemalloc_defs.h.in
|
01b3fe55ff3ac8e4aa689f09fcb0729da8037638 |
03-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Add a0malloc(), a0calloc(), and a0free(). Add a0malloc(), a0calloc(), and a0free(), which are used by FreeBSD's libc to allocate/deallocate TLS in static binaries.
emalloc/internal/arena.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/tcache.h
|
633aaff96787db82c06d35baf012de197a1a1902 |
03-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Postpone mutex initialization on FreeBSD. Postpone mutex initialization on FreeBSD until after base allocation is safe.
emalloc/internal/mutex.h
|
12a6845b6c91cf76caf3199495d76b16bba1f2fe |
03-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Use $((...)) instead of expr. Use $((...)) for math in size_classes.h rather than expr, because it is much faster. This is not supported syntax in the classic Bourne shell, but all modern sh implementations support it, including bash, zsh, and ash.
emalloc/internal/size_classes.sh
|
ae4c7b4b4092906c641d69b4bf9fcb4a7d50790d |
02-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Clean up *PAGE* macros. s/PAGE_SHIFT/LG_PAGE/g and s/PAGE_SIZE/PAGE/g. Remove remnants of the dynamic-page-shift code. Rename the "arenas.pagesize" mallctl to "arenas.page". Remove the "arenas.chunksize" mallctl, which is redundant with "opt.lg_chunk".
emalloc/internal/arena.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/size_classes.sh
emalloc/internal/tcache.h
|
f0047372673da7f213f733465dab0d8825eb1c9f |
03-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Revert "Avoid NULL check in free() and malloc_usable_size()." 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.
emalloc/internal/jemalloc_internal.h.in
|
96d4120ac08db3f2d566e8e5c3bc134a24aa0afc |
02-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Avoid NULL check in free() and malloc_usable_size(). 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.
emalloc/internal/jemalloc_internal.h.in
|
80b25932ca52e9506d4e2b8ee0fa58aa5ae3306d |
02-Apr-2012 |
Mike Hommey <mh@glandium.org> |
Move last bit of zone initialization in zone.c, and lazy-initialize
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/zone.h
|
722b370399fd6734de6781285ce9a0cffd547bdd |
02-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Use ffsl() in ALLOCM_ALIGN(). Use ffsl() rather than ffs() plus bitshifting in ALLOCM_ALIGN(). The original rational for using ffs() was portability, but the bitmap code has since induced a hard dependency on ffsl().
emalloc/jemalloc.h.in
|
4eeb52f080edb1f4b518249388f6c617386c00e5 |
02-Apr-2012 |
Jason Evans <jasone@canonware.com> |
Remove vsnprintf() and strtoumax() validation. Remove code that validates malloc_vsnprintf() and malloc_strtoumax() against their namesakes. The validation code has adequately served its usefulness at this point, and it isn't worth dealing with the different formatting for %p with glibc versus other implementations for NULL pointers ("(nil)" vs. "0x0"). Reported by Mike Hommey.
emalloc/internal/jemalloc_internal.h.in
|
f2296deb57cdda01685f0d0ccf3c6e200378c673 |
30-Mar-2012 |
Jason Evans <jasone@canonware.com> |
Clean up tsd (no functional changes).
emalloc/internal/tcache.h
emalloc/internal/tsd.h
|
09a0769ba7a3d139168e606e4295f8002861355f |
30-Mar-2012 |
Jason Evans <jasone@canonware.com> |
Work around TLS deallocation via free(). glibc uses memalign()/free() to allocate/deallocate TLS, which means that it is unsafe to set TLS variables as a side effect of free() -- they may already be deallocated. Work around this by avoiding tcache_create() within free(). Reported by Mike Hommey.
emalloc/internal/arena.h
emalloc/internal/tcache.h
|
71a93b8725fb52ae393ab88e2fccd5afa84c66a0 |
27-Mar-2012 |
Mike Hommey <mh@glandium.org> |
Move zone registration to zone.c
emalloc/internal/private_namespace.h
emalloc/internal/zone.h
|
1a0e7770243e0539fa8fef7bb1512f784f93389f |
27-Mar-2012 |
Mike Hommey <mh@glandium.org> |
Add a SYS_write definition on systems where it is not defined in headers Namely, in the Android NDK headers, SYS_write is not defined; but __NR_write is.
emalloc/internal/jemalloc_internal.h.in
|
d4be8b7b6ee2e21d079180455d4ccbf45cc1cee7 |
27-Mar-2012 |
Jason Evans <jasone@canonware.com> |
Add the "thread.tcache.enabled" mallctl.
emalloc/internal/tcache.h
|
c1e567bda042d94159026b96e7a77683606037fa |
26-Mar-2012 |
Mike Hommey <mh@glandium.org> |
Use __sync_add_and_fetch and __sync_sub_and_fetch when they are available 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.
emalloc/internal/atomic.h
emalloc/jemalloc_defs.h.in
|
1e6138c88c7f3bb1f0e8fb785080ac5abc24210c |
25-Mar-2012 |
Jason Evans <jasone@canonware.com> |
Remove malloc_mutex_trylock(). Remove malloc_mutex_trylock(); it has not been used for quite some time.
emalloc/internal/mutex.h
|
41b6afb834b1f5250223678c52bd4f013d4234f6 |
03-Feb-2012 |
Jason Evans <jasone@canonware.com> |
Port to FreeBSD. 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.
emalloc/internal/base.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/mutex.h
emalloc/internal/tsd.h
emalloc/internal/util.h
emalloc/jemalloc_defs.h.in
|
6da5418ded9170b087c35960e0010006430117c1 |
24-Mar-2012 |
Jason Evans <je@fb.com> |
Remove ephemeral mutexes. 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().
emalloc/internal/atomic.h
emalloc/internal/mutex.h
emalloc/internal/prof.h
|
06304a97854dbbf09075278fe2c90365254480da |
24-Mar-2012 |
Jason Evans <jasone@canonware.com> |
Restructure atomic_*_z(). Restructure atomic_*_z() so that no casting within macros is necessary. This avoids warnings when compiling with clang.
emalloc/internal/atomic.h
|
9225a1991a58190207cca2ff3cdba966bb322dd5 |
23-Mar-2012 |
Jason Evans <je@fb.com> |
Add JEMALLOC_CC_SILENCE_INIT(). Add JEMALLOC_CC_SILENCE_INIT(), which provides succinct syntax for initializing a variable to avoid a spurious compiler warning.
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/util.h
|
cd9a1346e96f71bdecdc654ea50fc62d76371e74 |
22-Mar-2012 |
Jason Evans <je@fb.com> |
Implement tsd. 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.
emalloc/internal/arena.h
emalloc/internal/chunk.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_namespace.h
emalloc/internal/prof.h
emalloc/internal/tcache.h
emalloc/internal/tsd.h
emalloc/internal/util.h
emalloc/jemalloc_defs.h.in
|
e24c7af35d1e9d24d02166ac98cfca7cf807ff13 |
19-Mar-2012 |
Jason Evans <je@fb.com> |
Invert NO_TLS to JEMALLOC_TLS.
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/prof.h
emalloc/internal/tcache.h
emalloc/jemalloc_defs.h.in
|
6508bc6931b54b50aaa0976ee7f0681482b2a80a |
16-Mar-2012 |
Jason Evans <je@fb.com> |
Remove #include <sys/sysctl.h>. Remove #include <sys/sysctl.h>, which is no longer needed (now using sysconf(3) to get number of CPUs).
emalloc/internal/jemalloc_internal.h.in
|
4e2e3dd9cf19ed5991938a708a8b50611aa5bbf8 |
14-Mar-2012 |
Jason Evans <je@fb.com> |
Fix fork-related bugs. 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.
emalloc/internal/arena.h
emalloc/internal/base.h
emalloc/internal/chunk_dss.h
emalloc/internal/huge.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/mutex.h
emalloc/internal/private_namespace.h
|
824d34e5b7f5cf00bf472ec79f7ec1c6e3474114 |
13-Mar-2012 |
Jason Evans <je@fb.com> |
Modify malloc_vsnprintf() validation code. Modify malloc_vsnprintf() validation code to verify that output is identical to vsnprintf() output, even if both outputs are truncated due to buffer exhaustion.
emalloc/internal/util.h
|
0a0bbf63e5d9bc60d6854c6d46b437fbeebd1470 |
13-Mar-2012 |
Jason Evans <je@fb.com> |
Implement aligned_alloc(). 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.
emalloc/jemalloc.h.in
emalloc/jemalloc_defs.h.in
|
4c2faa8a7c42a47a6bea509f5a23234bc5a66d40 |
13-Mar-2012 |
Jason Evans <je@fb.com> |
Fix a regression in JE_COMPILABLE(). 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.
emalloc/internal/jemalloc_internal.h.in
|
125b93e43fe764e46c8a89fc2f3957a4e02c92e1 |
12-Mar-2012 |
Jason Evans <je@fb.com> |
Remove bashism. Submitted by Mike Hommey.
emalloc/internal/size_classes.sh
|
d81e4bdd5c991bd5642c8b859ef1f752b51cd9be |
06-Mar-2012 |
Jason Evans <je@fb.com> |
Implement malloc_vsnprintf(). 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.
emalloc/internal/ctl.h
emalloc/internal/hash.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_namespace.h
emalloc/internal/stats.h
emalloc/internal/util.h
emalloc/jemalloc_defs.h.in
|
4507f34628dfae26e6b0a6faa13e5f9a49600616 |
05-Mar-2012 |
Jason Evans <je@fb.com> |
Remove the lg_tcache_gc_sweep option. 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.
emalloc/internal/tcache.h
|
b8c8be7f8abe72f4cb4f315f3078ad864fd6a2d8 |
05-Mar-2012 |
Jason Evans <je@fb.com> |
Use UINT64_C() rather than LLU for 64-bit constants.
emalloc/internal/hash.h
emalloc/internal/prof.h
|
3492daf1ce6fb85040d28dfd4dcb51cbf6b0da51 |
05-Mar-2012 |
Jason Evans <je@fb.com> |
Add SH4 and mips architecture support. Submitted by Andreas Vinsander.
emalloc/internal/atomic.h
emalloc/internal/jemalloc_internal.h.in
|
7e77eaffffe5c73d44ee64b14ba4b3d7693179d6 |
03-Mar-2012 |
Jason Evans <je@fb.com> |
Add the --disable-experimental option.
emalloc/jemalloc.h.in
emalloc/jemalloc_defs.h.in
|
84f7cdb0c588322dfd50a26497fc1cb54b792018 |
03-Mar-2012 |
Jason Evans <je@fb.com> |
Rename prn to prng. Rename prn to prng so that Windows doesn't choke when trying to create a file named prn.h.
emalloc/internal/ckh.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/prn.h
emalloc/internal/prng.h
emalloc/internal/prof.h
|
62320b85517c472beb12bf0ba69660393712f51a |
02-Mar-2012 |
Jason Evans <je@fb.com> |
Reorder macros.
emalloc/jemalloc.h.in
emalloc/jemalloc_defs.h.in
|
0a5489e37da88a1a50fbf8552e0d3a7f8fd93ffc |
02-Mar-2012 |
Jason Evans <je@fb.com> |
Add --with-mangling. 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.
emalloc/internal/ctl.h
emalloc/internal/jemalloc_internal.h.in
emalloc/jemalloc.h.in
emalloc/jemalloc_defs.h.in
|
7e15dab94d3f008b0a6c296ad7afec9ed47ff1ac |
29-Feb-2012 |
Jason Evans <je@fb.com> |
Add nallocm(). 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.
emalloc/internal/jemalloc_internal.h.in
emalloc/jemalloc.h.in
|
4bb09830133ffa8b27a95bc3727558007722c152 |
29-Feb-2012 |
Jason Evans <je@fb.com> |
Use glibc allocator hooks. 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.
emalloc/internal/jemalloc_internal.h.in
|
3add8d8cda2993f58fd2eba6efbf4fa12d5c72f3 |
29-Feb-2012 |
Jason Evans <je@fb.com> |
Remove unused variables in tcache_dalloc_large(). Submitted by Mike Hommey.
emalloc/internal/tcache.h
|
c90ad71237c05473bcb968beddebb0a487c36e75 |
29-Feb-2012 |
Jason Evans <je@fb.com> |
Remove the sysv option.
emalloc/internal/jemalloc_internal.h.in
emalloc/jemalloc_defs.h.in
|
b172610317babc7f365584ddd7fdaf4eb8d9d04c |
29-Feb-2012 |
Jason Evans <je@fb.com> |
Simplify small size class infrastructure. 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.
emalloc/internal/arena.h
emalloc/internal/atomic.h
emalloc/internal/ctl.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/mb.h
emalloc/internal/size_classes.sh
emalloc/internal/tcache.h
emalloc/jemalloc_defs.h.in
|
5389146191b279ca3b90028357dd6ad66b283def |
14-Feb-2012 |
Jason Evans <je@fb.com> |
Remove the opt.lg_prof_bt_max option. 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.
emalloc/internal/prof.h
|
0b526ff94da7e59aa947a4d3529b2376794f8b01 |
14-Feb-2012 |
Jason Evans <je@fb.com> |
Remove the opt.lg_prof_tcmax option. 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.
emalloc/internal/prof.h
|
746868929afae3e346b47d0fa8a78d7fb131d5a4 |
14-Feb-2012 |
Jason Evans <je@fb.com> |
Remove highruns statistics.
emalloc/internal/arena.h
emalloc/internal/stats.h
|
ef8897b4b938111fcc9b54725067f1dbb33a4c20 |
13-Feb-2012 |
Jason Evans <je@fb.com> |
Make 8-byte tiny size class non-optional. 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.
emalloc/internal/arena.h
emalloc/internal/jemalloc_internal.h.in
emalloc/jemalloc_defs.h.in
|
962463d9b57bcc65de2fa108a691b4183b9b2faf |
13-Feb-2012 |
Jason Evans <je@fb.com> |
Streamline tcache-related malloc/free fast paths. 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.
emalloc/internal/arena.h
emalloc/internal/tcache.h
|
4162627757889ea999264c2ddbc3c354768774e2 |
13-Feb-2012 |
Jason Evans <je@fb.com> |
Remove the swap feature. Remove the swap feature, which enabled per application swap files. In practice this feature has not proven itself useful to users.
emalloc/internal/chunk.h
emalloc/internal/chunk_swap.h
emalloc/internal/ctl.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_namespace.h
emalloc/jemalloc_defs.h.in
|
fd56043c53f1cd1335ae6d1c0ee86cc0fbb9f12e |
13-Feb-2012 |
Jason Evans <je@fb.com> |
Remove magic. Remove structure magic, because 1) it is no longer conditional, and 2) it stopped being very effective at detecting memory corruption several years ago.
emalloc/internal/arena.h
emalloc/internal/ckh.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/prof.h
emalloc/internal/tcache.h
|
7372b15a31c63ac5cb9ed8aeabc2a0a3c005e8bf |
11-Feb-2012 |
Jason Evans <je@fb.com> |
Reduce cpp conditional logic complexity. 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.
emalloc/internal/arena.h
emalloc/internal/chunk.h
emalloc/internal/chunk_dss.h
emalloc/internal/chunk_swap.h
emalloc/internal/ckh.h
emalloc/internal/ctl.h
emalloc/internal/extent.h
emalloc/internal/huge.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/mutex.h
emalloc/internal/prof.h
emalloc/internal/stats.h
emalloc/internal/tcache.h
emalloc/jemalloc_defs.h.in
|
12a488782681cbd740a5f54e0b7e74ea84858e21 |
11-Nov-2011 |
Jason Evans <je@fb.com> |
Fix huge_ralloc to maintain chunk statistics. Fix huge_ralloc() to properly maintain chunk statistics when using mremap(2).
emalloc/internal/chunk.h
|
da9dde0854b2240882867f192a59ad391f4bf92b |
02-Nov-2011 |
Jason Evans <je@fb.com> |
Clean up rb documentation.
emalloc/internal/rb.h
|
a507004d294ad0c78b4d01559479620ebb272a49 |
12-Aug-2011 |
Jason Evans <je@fb.com> |
Fix off-by-one backtracing issues. 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.
emalloc/internal/private_namespace.h
emalloc/internal/prof.h
|
04ca1efe35349a6114523b37abbd4ca066cd17fa |
31-Jul-2011 |
Jason Evans <jasone@canonware.com> |
Adjust relative #include for private_namespace.h.
emalloc/internal/jemalloc_internal.h.in
|
746e77a06bf1089d50fbd64e1759b96c1cfbd9f5 |
31-Jul-2011 |
Jason Evans <je@fb.com> |
Add the --with-private-namespace option. Add the --with-private-namespace option to make it possible to work around library-private symbols being exposed in static libraries.
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/private_namespace.h
emalloc/jemalloc_defs.h.in
|
f0b22cf932b6fa7be2027a1058802fab0d6e25c6 |
22-May-2011 |
Jason Evans <jasone@canonware.com> |
Use LLU suffix for all 64-bit constants. Add the LLU suffix for all 0x... 64-bit constants. Reported by Jakob Blomer.
emalloc/internal/hash.h
|
7427525c28d58c423a68930160e3b0fe577fe953 |
01-Apr-2011 |
Jason Evans <jasone@canonware.com> |
Move repo contents in jemalloc/ to top level.
emalloc/internal/arena.h
emalloc/internal/atomic.h
emalloc/internal/base.h
emalloc/internal/bitmap.h
emalloc/internal/chunk.h
emalloc/internal/chunk_dss.h
emalloc/internal/chunk_mmap.h
emalloc/internal/chunk_swap.h
emalloc/internal/ckh.h
emalloc/internal/ctl.h
emalloc/internal/extent.h
emalloc/internal/hash.h
emalloc/internal/huge.h
emalloc/internal/jemalloc_internal.h.in
emalloc/internal/mb.h
emalloc/internal/mutex.h
emalloc/internal/prn.h
emalloc/internal/prof.h
emalloc/internal/ql.h
emalloc/internal/qr.h
emalloc/internal/rb.h
emalloc/internal/rtree.h
emalloc/internal/stats.h
emalloc/internal/tcache.h
emalloc/internal/zone.h
emalloc/jemalloc.h.in
emalloc/jemalloc_defs.h.in
|