Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Update to jemalloc 4.0.3 #14

Closed
wants to merge 402 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
402 commits
Select commit Hold shift + click to select a range
c83bccd
Initialize chunks_mtx for all configurations.
Oct 16, 2014
a9ea10d
use sized deallocation internally for ralloc
thestinger Oct 16, 2014
8f47e3d
Merge pull request #151 from thestinger/ralloc
jasone Oct 16, 2014
79725aa
Fix variable declaration with no type in the configure script.
eggpi Oct 20, 2014
1f725eb
Merge pull request #154 from guilherme-pg/implicit-int
jasone Oct 20, 2014
af1f592
Use JEMALLOC_INLINE_C everywhere it's appropriate.
jasone Oct 30, 2014
c93ed81
Fix prof_{enter,leave}() calls to pass tdata_self.
jasone Oct 30, 2014
809b0ac
mark huge allocations as unlikely
thestinger Oct 23, 2014
d33f834
avoid redundant chunk header reads
thestinger Oct 24, 2014
cfc5706
Miscellaneous cleanups.
jasone Oct 31, 2014
dc65213
rm unused arena wrangling from xallocx
thestinger Oct 31, 2014
6da2e9d
Fix arena_sdalloc() to use promoted size.
jasone Nov 1, 2014
d7a9bab
Fix arena_sdalloc() to use promoted size (second attempt).
jasone Nov 1, 2014
82cb603
Don't dereference NULL tdata in prof_{enter,leave}().
jasone Nov 1, 2014
2b2f6dc
Disable arena_dirty_count() validation.
jasone Nov 1, 2014
c002a5c
Fix two quarantine regressions.
jasone Nov 5, 2014
9cf2be0
Make quarantine_init() static.
Nov 7, 2014
2012d5a
Fix pointer arithmetic undefined behavior.
Nov 17, 2014
d49cb68
Fix more pointer arithmetic undefined behavior.
Nov 17, 2014
a213602
Remove extra definition of je_tsd_boot on win32.
eggpi Nov 18, 2014
879e76a
teach the dss chunk allocator to handle new_addr
thestinger Nov 3, 2014
f79e01f
Fix test_stats_arenas_bins for 32-bit builds.
yumkam Dec 3, 2014
1036ddb
Fix OOM cleanup in huge_palloc().
Dec 5, 2014
a18c2b1
Style fixes.
jasone Dec 6, 2014
59cd80e
Add a C11 atomics-based implementation of atomic.h API.
chih-hung Dec 6, 2014
e12eaf9
Style and spelling fixes.
Dec 8, 2014
b74041f
Ignore MALLOC_CONF in set{uid,gid,cap} binaries.
thestinger Dec 9, 2014
2c5cb61
Introduce two new modes of junk filling: "alloc" and "free".
eggpi Dec 8, 2014
b4acf73
[pprof] Produce global profile unless thread-local profile requested
bertmaher Oct 24, 2014
9c6a8d3
Move variable declaration to the top its block for MSVC compatibility.
eggpi Dec 17, 2014
b7b44df
Make mixed declarations an error
glandium Dec 18, 2014
51f8634
Add a isblank definition for MSVC < 2013
eggpi Dec 18, 2014
24057f3
Fix an infinite recursion bug related to a0/tsd bootstrapping.
jasone Jan 15, 2015
44b57b8
Fix OOM handling in memalign() and valloc().
Jan 17, 2015
b617df8
Add missing symbols to private_symbols.txt.
adk9 Jan 21, 2015
bc96876
Fix arenas_cache_cleanup().
Jan 21, 2015
10aff3f
Refactor bootstrapping to delay tsd initialization.
jasone Jan 20, 2015
228b2e9
Document under what circumstances in-place resizing succeeds.
Jan 22, 2015
8afcaa9
Update copyright dates for 2015.
Jan 23, 2015
bec6a8d
Implement the jemalloc-config script.
Jan 23, 2015
ec98a44
Use the correct type for opt.junk when printing stats.
eggpi Jan 23, 2015
4581b97
Implement metadata statistics.
Nov 27, 2014
eee27b2
huge_node_locked don't have to unlock huge_mtx
semarie Jan 25, 2015
77d597e
add openbsd support
semarie Jan 25, 2015
0fd663e
Avoid pointless chunk_recycle() call.
jasone Jan 26, 2015
41f2e69
Fix quoting for CONFIG-related sed expression.
jasone Jan 26, 2015
5b8ed5b
Implement the prof.gdump mallctl.
jasone Jan 26, 2015
008267b
util.c: strerror_r returns char* only on glibc
doughdemon Feb 3, 2015
6505733
Make opt.lg_dirty_mult work as documented
glandium Feb 3, 2015
b0808d5
Fix shell test to use = instead of ==.
jasone Feb 3, 2015
f872357
Add missing prototypes for bootstrap_{malloc,calloc,free}().
jasone Feb 3, 2015
8ddc932
Fix chunk_recycle()'s new_addr functionality.
jasone Jan 31, 2015
a55dfa4
Implement more atomic operations.
Feb 2, 2015
918a1a5
Reduce extent_node_t size to fit in one cache line.
jasone Jan 31, 2015
f500a10
Refactor base_alloc() to guarantee demand-zeroed memory.
jasone Jan 31, 2015
c810fce
Add (x != 0) assertion to lg_floor(x).
jasone Feb 5, 2015
8d0e04d
Refactor rtree to be lock-free.
jasone Jan 31, 2015
23694b0
Fix arena_get() for (!init_if_missing && refresh_if_missing) case.
Feb 10, 2015
1cb181e
Implement explicit tcache support.
Jan 29, 2015
9e561e8
Test and fix tcache ID recycling.
jasone Feb 10, 2015
051eae8
Remove unnecessary xchg* lock prefixes.
Feb 11, 2015
064dbfb
Fix a regression in tcache_bin_flush_small().
jasone Feb 12, 2015
f30e261
Update ckh to support metadata allocation tracking.
jasone Feb 12, 2015
cbf3a6d
Move centralized chunk management into arenas.
jasone Feb 11, 2015
1eaf3b6
add missing check for new_addr chunk size
thestinger Feb 12, 2015
88fef7c
Refactor huge_*() calls into arena internals.
Feb 12, 2015
5f7140b
Make prof_tctx accesses atomic.
Feb 12, 2015
ab5e379
Build docs in object directory
dankm Dec 23, 2014
f888031
Put VERSION file in object directory
dankm Dec 23, 2014
feaaa3d
Take into account the install suffix that jemalloc was built with in …
Feb 11, 2015
41cfe03
If MALLOCX_ARENA(a) is specified, use it during tcache fill.
Feb 13, 2015
b01186c
Remove redundant tcache_boot() call.
jasone Feb 15, 2015
2195ba4
Normalize *_link and link_* fields to all be *_link.
jasone Feb 16, 2015
02e5dcf
Fix --enable-debug regression.
jasone Feb 16, 2015
cb9b449
Remove obsolete (incorrect) assertions.
jasone Feb 16, 2015
40ab8f9
Remove more obsolete (incorrect) assertions.
jasone Feb 16, 2015
ee41ad4
Integrate whole chunks into unused dirty page purging machinery.
jasone Feb 16, 2015
a4e1888
Simplify extent_node_t and add extent_node_init().
jasone Feb 17, 2015
eafebfd
Remove obsolete type arena_chunk_miscelms_t.
jasone Feb 18, 2015
47701b2
arena_chunk_dirty_node_init() --> extent_node_dirty_linkage_init()
jasone Feb 18, 2015
339c2b2
Fix chunk_unmap() to propagate dirty state.
jasone Feb 18, 2015
738e089
Rename "dirty chunks" to "cached chunks".
jasone Feb 18, 2015
99bd94f
Fix chunk cache races.
jasone Feb 19, 2015
35e3fd9
Fix a compilation error and an incorrect assertion.
jasone Feb 19, 2015
970fcfb
adding support for bitrig
Feb 10, 2015
7c46fd5
Make --without-export actually work
glandium Mar 4, 2015
4d871f7
Preserve LastError when calling TlsGetValue
glandium Mar 4, 2015
f044bb2
Change default chunk size from 4 MiB to 256 KiB.
jasone Mar 7, 2015
5707d6f
Quantize szad trees by size class.
jasone Mar 7, 2015
97c04a9
Use first-fit rather than first-best-fit run/chunk allocation.
jasone Mar 7, 2015
04ca758
Fix a chunk_recycle() regression.
jasone Mar 7, 2015
54673fd
Update ChangeLog.
Feb 24, 2015
38e42d3
Refactor dirty run linkage to reduce sizeof(extent_node_t).
Mar 11, 2015
f5c8f37
Normalize rdelm/rd structure field naming.
Mar 11, 2015
bc45d41
Fix a declaration-after-statement regression.
Mar 11, 2015
fbd8d77
Fix unsigned comparison underflow.
Mar 12, 2015
d69964b
Fix a heap profiling regression.
Mar 12, 2015
f69e2f6
Use the error code given to buferror on Windows
glandium Mar 11, 2015
d6384b0
use CLOCK_MONOTONIC in the timer if it's available
thestinger Oct 16, 2014
764b000
Fix a heap profiling regression.
Mar 14, 2015
262146d
Eliminate innocuous compiler warnings.
jasone Mar 14, 2015
04211e2
Fix heap profiling regressions.
Mar 16, 2015
c9db461
Use InterlockedCompareExchange instead of non-existing InterlockedCom…
glandium Mar 17, 2015
8d6a3e8
Implement dynamic per arena control over dirty page purging.
Mar 19, 2015
e0a08a1
Restore --enable-ivsalloc.
jasone Mar 19, 2015
7e336e7
Fix lg_dirty_mult-related stats printing.
jasone Mar 21, 2015
fd5901c
Fix a compile error caused by mixed declarations and code.
Mar 21, 2015
8ad6bf3
Fix indentation inconsistencies.
poige Mar 21, 2015
4acd75a
Add the "stats.allocated" mallctl.
jasone Mar 24, 2015
ef0a0cc
We have pages_unmap(ret, size) so we use it.
poige Mar 22, 2015
d324ca8
Fix arena_get() usage.
jasone Mar 24, 2015
bd16ea4
Fix signed/unsigned comparison in arena_lg_dirty_mult_valid().
jasone Mar 24, 2015
562d266
Add the "stats.arenas.<i>.lg_dirty_mult" mallctl.
jasone Mar 24, 2015
65db63c
Fix in-place shrinking huge reallocation purging bugs.
Mar 26, 2015
b80fbcb
OpenBSD don't support TLS
semarie Apr 7, 2015
8975035
Fix mallctl doc: arenas.hchunk.<i>.size
Apr 21, 2015
95e88de
Concise JEMALLOC_HAVE_ISSETUGID case in secure_getenv().
poige Mar 24, 2015
f1f2b45
Embed full library install when running ld on OS X.
jasone May 1, 2015
8e33c21
Prefer /proc/<pid>/task/<pid>/maps over /proc/<pid>/maps on Linux.
jasone May 1, 2015
7041720
Rename pprof to jeprof.
jasone May 1, 2015
6bb54cb
Clean up bin/jeprof in distclean build target.
jasone May 5, 2015
8a03cf0
Implement cache index randomization for large allocations.
jasone May 4, 2015
c451831
Fix type punning in calls to atomic operation functions.
jasone May 8, 2015
fd5f9e4
Avoid atomic operations for dependent rtree reads.
jasone May 16, 2015
5aa50a2
Fix nhbins calculation.
jasone May 20, 2015
5154175
Fix performance regression in arena_palloc().
jasone May 20, 2015
6591ff0
Fix arena_dalloc() performance regression.
jasone May 20, 2015
836bbe9
Impose a minimum tcache count for small size classes.
jasone May 20, 2015
c073f81
Fix type errors in C11 versions of atomic_*() functions.
chih-hung May 28, 2015
09983d2
Bypass tcache when draining quarantined allocations.
May 30, 2015
56048ba
Clarify relationship between stats.resident and stats.mapped.
May 28, 2015
713b844
Update a comment.
Jun 15, 2015
4f6f2b1
Fix two valgrind integration regressions.
jasone Jun 22, 2015
dc0610a
Add alignment assertions to public aligned allocation functions.
jasone Jun 23, 2015
0a9f9a4
Convert arena_maybe_purge() recursion to iteration.
jasone Jun 23, 2015
241abc6
Fix size class overflow handling when profiling is enabled.
jasone Jun 24, 2015
a1aaf94
Optimizations for Windows
mlvdm Jun 25, 2015
bce61d6
Move a variable declaration closer to its use.
jasone Jul 7, 2015
be09b81
Minor ChangeLog edit.
jasone Jul 7, 2015
ad6800f
Fix typos ChangeLog
charsyam Jul 3, 2015
0dd3ad3
Fix an assignment type warning for tls_callback.
jasone Jul 7, 2015
0313607
Fix MinGW build warnings.
jasone Jul 7, 2015
b946086
Use jemalloc_ffs() rather than ffs().
jasone Jul 8, 2015
d508ec7
Fix a variable declaration typo.
jasone Jul 8, 2015
32dca11
Add a missing ChangeLog entry.
Jul 9, 2015
7ae1239
Fix indentation.
Jul 9, 2015
dde0672
Fix an integer overflow bug in {size2index,s2u}_compute().
Jul 10, 2015
ae93d6b
Avoid function prototype incompatibilities.
jasone Jul 10, 2015
0b8f0bc
Add configure test for alloc_size attribute.
Jul 10, 2015
92d72ee
Fix alloc_size configure test.
jasone Jul 10, 2015
8693a9e
Add timer support for Windows.
jasone Jul 13, 2015
aa28266
Revert to first-best-fit run/chunk allocation.
jasone Jul 15, 2015
5bd8796
Change default chunk size from 256 KiB to 2 MiB.
jasone Jul 16, 2015
37fd111
Remove extraneous ';' on closing 'extern "C"'
daverigby Jul 16, 2015
f2bc852
Add the config.cache_oblivious mallctl.
jasone Jul 17, 2015
218b15c
Fix more MinGW build warnings.
jasone Jul 18, 2015
50cd636
Remove JEMALLOC_ALLOC_SIZE annotations on functions not returning poi…
glandium Jul 21, 2015
0063260
Move JEMALLOC_NOTHROW just after return type.
jasone Jul 21, 2015
1b0e4ab
Port mq_get() to MinGW.
jasone Jul 21, 2015
e42c309
Add JEMALLOC_FORMAT_PRINTF().
jasone Jul 22, 2015
e475ff1
Fix a compilation error.
jasone Jul 22, 2015
5fae7dc
Fix MinGW-related portability issues.
jasone Jul 23, 2015
13473c7
Force lazy_lock on MinGW.
jasone Jul 23, 2015
71cd2f0
Leave PRI* macros defined after using them to define FMT*.
jasone Jul 23, 2015
50883de
Change arena_palloc_large() parameter from size to usize.
jasone Jul 24, 2015
4becdf2
Fix sa2u() regression.
jasone Jul 24, 2015
87ccb55
Fix huge_palloc() to handle size rather than usize input.
jasone Jul 24, 2015
40cbd30
Fix huge_ralloc_no_move() to succeed more often.
jasone Jul 25, 2015
d059b9d
Implement support for non-coalescing maps on MinGW.
jasone Jul 25, 2015
b49a334
Generalize chunk management hooks.
Jul 28, 2015
c1a6a51
MSVC compatibility changes
mlvdm Jul 27, 2015
67c46a9
work around _FORTIFY_SOURCE false positive
thestinger Aug 1, 2015
5716d97
Fix an in-place growing large reallocation regression.
jasone Aug 7, 2015
8fadb1a
Implement chunk hook support for page run commit/decommit.
jasone Aug 4, 2015
4be0c3c
Add no-OOM assertions to test.
jasone Aug 7, 2015
de249c8
Arena chunk decommit cleanups and fixes.
jasone Aug 9, 2015
45186f0
Refactor arena_mapbits unzeroed flag management.
jasone Aug 11, 2015
ac5db02
Make --enable-tls and --enable-lazy-lock take precedence over configu…
glandium Aug 11, 2015
6bdeddb
Fix build failure.
jasone Aug 11, 2015
1f27abc
Refactor arena_mapbits_{small,large}_set() to not preserve unzeroed.
jasone Aug 11, 2015
03bf5b6
Try to decommit new chunks.
jasone Aug 12, 2015
2662ba5
Stop forcing --enable-munmap on MinGW.
jasone Aug 12, 2015
e1ed698
Remove obsolete entry.
jasone Aug 12, 2015
38d8f50
Fix assertion in test.
jasone Aug 12, 2015
694d082
Update list of private symbols.
jasone Aug 12, 2015
6ed18cb
Fix chunk_dalloc_arena() re: zeroing due to purge.
jasone Aug 12, 2015
828d919
Fix test for MinGW.
jasone Aug 12, 2015
56af64d
Fix a strict aliasing violation.
jasone Aug 12, 2015
7928f62
Check whether gcc version supports __builtin_unreachable().
jasone Aug 12, 2015
fead75f
Fix gcc build failure (define __has_builtin).
jasone Aug 12, 2015
85ae064
Fix a comment.
jasone Aug 13, 2015
a5dbaef
Update large/huge size class cutoff documentation.
jasone Aug 14, 2015
38f8649
Update in-place reallocation documentation.
jasone Aug 14, 2015
92e96e3
Improve arena.<i>.chunk_hooks documentation formatting.
jasone Aug 14, 2015
9b68f67
Update ChangeLog for 4.0.0.
jasone Aug 17, 2015
6e98caf
Merge branch 'dev'
jasone Aug 17, 2015
5ef33a9
Don't bitshift by negative amounts.
jasone Aug 19, 2015
d01fd19
Rename index_t to szind_t to avoid an existing type on Solaris.
jasone Aug 19, 2015
b5c2a34
Silence compiler warnings for unreachable code.
jasone Aug 20, 2015
45e9f66
Fix arenas_cache_cleanup().
cferris1000 Aug 21, 2015
5d2e875
Add JEMALLOC_CXX_THROW to the memalign() function prototype.
jasone Aug 26, 2015
30949da
Fix arenas_cache_cleanup() and arena_get_hard().
Aug 25, 2015
6d8075f
Fix chunk purge hook calls for in-place huge shrinking reallocation.
glandium Aug 28, 2015
4a2a3c9
Don't purge junk filled chunks when shrinking huge allocations
glandium Aug 28, 2015
c0f43b6
Fix TLS configuration.
jasone Sep 2, 2015
594c759
Optimize arena_prof_tctx_set().
jasone Sep 2, 2015
b4330b0
Fix pointer comparision with undefined behavior.
Sep 4, 2015
0a116fa
Force initialization of the init_lock in malloc_init_hard on Windows XP
glandium Sep 3, 2015
a306a60
Reduce variables scope
Dmitry-Me Sep 4, 2015
a00b107
Fix "prof.reset" mallctl-related corruption.
jasone Sep 10, 2015
560a4e1
Fix xallocx() bugs.
jasone Sep 11, 2015
676df88
Rename arena_maxclass to large_maxclass.
jasone Sep 12, 2015
8f57e3f
Remove check_stress from check target's dependencies.
jasone Sep 12, 2015
4acb6c7
Fix ixallocx_prof() size+extra overflow.
jasone Sep 15, 2015
46ff049
Optimize irallocx_prof() to optimistically update the sampler state.
jasone Sep 15, 2015
ef363de
Fix irealloc_prof() to prof_alloc_rollback() on OOM.
jasone Sep 15, 2015
cec0d63
Make one call to prof_active_get_unlocked() per allocation event.
jasone Sep 15, 2015
d970404
s/oldptr/old_ptr/g
jasone Sep 15, 2015
ce9a4e3
s/max_usize/usize_max/g
jasone Sep 15, 2015
23f6e10
Fix ixallocx_prof_sample() argument order reversal.
jasone Sep 15, 2015
ea8d97b
Fix prof_{malloc,free}_sample_object() call order in prof_realloc().
jasone Sep 15, 2015
708ed79
Resolve an unsupported special case in arena_prof_tctx_set().
jasone Sep 15, 2015
0108b1f
Don't run stress tests as part of check target.
jasone Sep 15, 2015
8c485b0
Fix ixallocx_prof() to check for size greater than HUGE_MAXCLASS.
jasone Sep 15, 2015
6d91929
Address portability issues on Solaris.
jasone Sep 15, 2015
78ae1ac
Reduce variable scope.
Dmitry-Me Sep 8, 2015
aca490f
Add more xallocx() overflow tests.
jasone Sep 15, 2015
9a505b7
Centralize xallocx() size[+extra] overflow checks.
jasone Sep 15, 2015
345c1b0
Link test to librt if it contains clock_gettime(2).
jasone Sep 15, 2015
65b940a
Loosen expected xallocx() results.
jasone Sep 15, 2015
1d7540c
Update ChangeLog for 4.0.1.
jasone Sep 15, 2015
9898051
Merge branch 'dev'
jasone Sep 15, 2015
38e2c8f
Fix ixallocx_prof_sample().
jasone Sep 17, 2015
4be9c79
Fix irallocx_prof_sample().
jasone Sep 17, 2015
3263be6
Simplify imallocx_prof_sample().
jasone Sep 17, 2015
3ca0cf6
Fix prof_alloc_rollback().
jasone Sep 17, 2015
4d0e162
Expand check_integration_prof testing.
jasone Sep 17, 2015
2152329
Add mallocx() OOM tests.
jasone Sep 17, 2015
e56b24e
Make arena_dalloc_large_locked_impl() static.
jasone Sep 20, 2015
66814c1
Fix tsd_boot1() to use explicit 'void' parameter list.
rodrigc Sep 21, 2015
b8e966f
Update ChangeLog for 4.0.2.
jasone Sep 21, 2015
486d249
Merge branch 'dev'
jasone Sep 21, 2015
fb64ec2
Fix prof_tctx_dump_iter() to filter.
jasone Sep 22, 2015
d260f44
Fix xallocx(..., MALLOCX_ZERO) bugs.
jasone Sep 24, 2015
03eb37e
Make mallocx() OOM test more robust.
jasone Sep 24, 2015
d36c7eb
Work around an NPTL-specific TSD issue.
jasone Sep 24, 2015
044047f
Remove fragile xallocx() test case.
jasone Sep 25, 2015
0270968
Update ChangeLog for 4.0.3.
jasone Sep 25, 2015
e9192ea
Merge branch 'dev'
jasone Sep 25, 2015
0242aee
Check-in the generated configure script
fbernier Oct 21, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .autom4te.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
begin-language: "Autoconf-without-aclocal-m4"
args: --no-cache
end-language: "Autoconf-without-aclocal-m4"
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*.gcov.*

/autom4te.cache/

/bin/jemalloc-config
/bin/jemalloc.sh
/bin/jeprof

/config.stamp
/config.log
Expand All @@ -15,6 +15,8 @@
/doc/jemalloc.html
/doc/jemalloc.3

/jemalloc.pc

/lib/

/Makefile
Expand All @@ -35,6 +37,7 @@
/include/jemalloc/jemalloc_protos.h
/include/jemalloc/jemalloc_protos_jet.h
/include/jemalloc/jemalloc_rename.h
/include/jemalloc/jemalloc_typedefs.h

/src/*.[od]
/src/*.gcda
Expand Down
4 changes: 2 additions & 2 deletions COPYING
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Unless otherwise specified, files in the jemalloc source distribution are
subject to the following license:
--------------------------------------------------------------------------------
Copyright (C) 2002-2014 Jason Evans <[email protected]>.
Copyright (C) 2002-2015 Jason Evans <[email protected]>.
All rights reserved.
Copyright (C) 2007-2012 Mozilla Foundation. All rights reserved.
Copyright (C) 2009-2014 Facebook, Inc. All rights reserved.
Copyright (C) 2009-2015 Facebook, Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
250 changes: 245 additions & 5 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,10 +1,250 @@
Following are change highlights associated with official releases. Important
bug fixes are all mentioned, but internal enhancements are omitted here for
brevity (even though they are more fun to write about). Much more detail can be
found in the git revision history:
bug fixes are all mentioned, but some internal enhancements are omitted here for
brevity. Much more detail can be found in the git revision history:

https://github.com/jemalloc/jemalloc

* 4.0.3 (September 24, 2015)

This bugfix release continues the trend of xallocx() and heap profiling fixes.

Bug fixes:
- Fix xallocx(..., MALLOCX_ZERO) to zero all trailing bytes of large
allocations when --enable-cache-oblivious configure option is enabled.
- Fix xallocx(..., MALLOCX_ZERO) to zero trailing bytes of huge allocations
when resizing from/to a size class that is not a multiple of the chunk size.
- Fix prof_tctx_dump_iter() to filter out nodes that were created after heap
profile dumping started.
- Work around a potentially bad thread-specific data initialization
interaction with NPTL (glibc's pthreads implementation).

* 4.0.2 (September 21, 2015)

This bugfix release addresses a few bugs specific to heap profiling.

Bug fixes:
- Fix ixallocx_prof_sample() to never modify nor create sampled small
allocations. xallocx() is in general incapable of moving small allocations,
so this fix removes buggy code without loss of generality.
- Fix irallocx_prof_sample() to always allocate large regions, even when
alignment is non-zero.
- Fix prof_alloc_rollback() to read tdata from thread-specific data rather
than dereferencing a potentially invalid tctx.

* 4.0.1 (September 15, 2015)

This is a bugfix release that is somewhat high risk due to the amount of
refactoring required to address deep xallocx() problems. As a side effect of
these fixes, xallocx() now tries harder to partially fulfill requests for
optional extra space. Note that a couple of minor heap profiling
optimizations are included, but these are better thought of as performance
fixes that were integral to disovering most of the other bugs.

Optimizations:
- Avoid a chunk metadata read in arena_prof_tctx_set(), since it is in the
fast path when heap profiling is enabled. Additionally, split a special
case out into arena_prof_tctx_reset(), which also avoids chunk metadata
reads.
- Optimize irallocx_prof() to optimistically update the sampler state. The
prior implementation appears to have been a holdover from when
rallocx()/xallocx() functionality was combined as rallocm().

Bug fixes:
- Fix TLS configuration such that it is enabled by default for platforms on
which it works correctly.
- Fix arenas_cache_cleanup() and arena_get_hard() to handle
allocation/deallocation within the application's thread-specific data
cleanup functions even after arenas_cache is torn down.
- Fix xallocx() bugs related to size+extra exceeding HUGE_MAXCLASS.
- Fix chunk purge hook calls for in-place huge shrinking reallocation to
specify the old chunk size rather than the new chunk size. This bug caused
no correctness issues for the default chunk purge function, but was
visible to custom functions set via the "arena.<i>.chunk_hooks" mallctl.
- Fix heap profiling bugs:
+ Fix heap profiling to distinguish among otherwise identical sample sites
with interposed resets (triggered via the "prof.reset" mallctl). This bug
could cause data structure corruption that would most likely result in a
segfault.
+ Fix irealloc_prof() to prof_alloc_rollback() on OOM.
+ Make one call to prof_active_get_unlocked() per allocation event, and use
the result throughout the relevant functions that handle an allocation
event. Also add a missing check in prof_realloc(). These fixes protect
allocation events against concurrent prof_active changes.
+ Fix ixallocx_prof() to pass usize_max and zero to ixallocx_prof_sample()
in the correct order.
+ Fix prof_realloc() to call prof_free_sampled_object() after calling
prof_malloc_sample_object(). Prior to this fix, if tctx and old_tctx were
the same, the tctx could have been prematurely destroyed.
- Fix portability bugs:
+ Don't bitshift by negative amounts when encoding/decoding run sizes in
chunk header maps. This affected systems with page sizes greater than 8
KiB.
+ Rename index_t to szind_t to avoid an existing type on Solaris.
+ Add JEMALLOC_CXX_THROW to the memalign() function prototype, in order to
match glibc and avoid compilation errors when including both
jemalloc/jemalloc.h and malloc.h in C++ code.
+ Don't assume that /bin/sh is appropriate when running size_classes.sh
during configuration.
+ Consider __sparcv9 a synonym for __sparc64__ when defining LG_QUANTUM.
+ Link tests to librt if it contains clock_gettime(2).

* 4.0.0 (August 17, 2015)

This version contains many speed and space optimizations, both minor and
major. The major themes are generalization, unification, and simplification.
Although many of these optimizations cause no visible behavior change, their
cumulative effect is substantial.

New features:
- Normalize size class spacing to be consistent across the complete size
range. By default there are four size classes per size doubling, but this
is now configurable via the --with-lg-size-class-group option. Also add the
--with-lg-page, --with-lg-page-sizes, --with-lg-quantum, and
--with-lg-tiny-min options, which can be used to tweak page and size class
settings. Impacts:
+ Worst case performance for incrementally growing/shrinking reallocation
is improved because there are far fewer size classes, and therefore
copying happens less often.
+ Internal fragmentation is limited to 20% for all but the smallest size
classes (those less than four times the quantum). (1B + 4 KiB)
and (1B + 4 MiB) previously suffered nearly 50% internal fragmentation.
+ Chunk fragmentation tends to be lower because there are fewer distinct run
sizes to pack.
- Add support for explicit tcaches. The "tcache.create", "tcache.flush", and
"tcache.destroy" mallctls control tcache lifetime and flushing, and the
MALLOCX_TCACHE(tc) and MALLOCX_TCACHE_NONE flags to the *allocx() API
control which tcache is used for each operation.
- Implement per thread heap profiling, as well as the ability to
enable/disable heap profiling on a per thread basis. Add the "prof.reset",
"prof.lg_sample", "thread.prof.name", "thread.prof.active",
"opt.prof_thread_active_init", "prof.thread_active_init", and
"thread.prof.active" mallctls.
- Add support for per arena application-specified chunk allocators, configured
via the "arena.<i>.chunk_hooks" mallctl.
- Refactor huge allocation to be managed by arenas, so that arenas now
function as general purpose independent allocators. This is important in
the context of user-specified chunk allocators, aside from the scalability
benefits. Related new statistics:
+ The "stats.arenas.<i>.huge.allocated", "stats.arenas.<i>.huge.nmalloc",
"stats.arenas.<i>.huge.ndalloc", and "stats.arenas.<i>.huge.nrequests"
mallctls provide high level per arena huge allocation statistics.
+ The "arenas.nhchunks", "arenas.hchunk.<i>.size",
"stats.arenas.<i>.hchunks.<j>.nmalloc",
"stats.arenas.<i>.hchunks.<j>.ndalloc",
"stats.arenas.<i>.hchunks.<j>.nrequests", and
"stats.arenas.<i>.hchunks.<j>.curhchunks" mallctls provide per size class
statistics.
- Add the 'util' column to malloc_stats_print() output, which reports the
proportion of available regions that are currently in use for each small
size class.
- Add "alloc" and "free" modes for for junk filling (see the "opt.junk"
mallctl), so that it is possible to separately enable junk filling for
allocation versus deallocation.
- Add the jemalloc-config script, which provides information about how
jemalloc was configured, and how to integrate it into application builds.
- Add metadata statistics, which are accessible via the "stats.metadata",
"stats.arenas.<i>.metadata.mapped", and
"stats.arenas.<i>.metadata.allocated" mallctls.
- Add the "stats.resident" mallctl, which reports the upper limit of
physically resident memory mapped by the allocator.
- Add per arena control over unused dirty page purging, via the
"arenas.lg_dirty_mult", "arena.<i>.lg_dirty_mult", and
"stats.arenas.<i>.lg_dirty_mult" mallctls.
- Add the "prof.gdump" mallctl, which makes it possible to toggle the gdump
feature on/off during program execution.
- Add sdallocx(), which implements sized deallocation. The primary
optimization over dallocx() is the removal of a metadata read, which often
suffers an L1 cache miss.
- Add missing header includes in jemalloc/jemalloc.h, so that applications
only have to #include <jemalloc/jemalloc.h>.
- Add support for additional platforms:
+ Bitrig
+ Cygwin
+ DragonFlyBSD
+ iOS
+ OpenBSD
+ OpenRISC/or1k

Optimizations:
- Maintain dirty runs in per arena LRUs rather than in per arena trees of
dirty-run-containing chunks. In practice this change significantly reduces
dirty page purging volume.
- Integrate whole chunks into the unused dirty page purging machinery. This
reduces the cost of repeated huge allocation/deallocation, because it
effectively introduces a cache of chunks.
- Split the arena chunk map into two separate arrays, in order to increase
cache locality for the frequently accessed bits.
- Move small run metadata out of runs, into arena chunk headers. This reduces
run fragmentation, smaller runs reduce external fragmentation for small size
classes, and packed (less uniformly aligned) metadata layout improves CPU
cache set distribution.
- Randomly distribute large allocation base pointer alignment relative to page
boundaries in order to more uniformly utilize CPU cache sets. This can be
disabled via the --disable-cache-oblivious configure option, and queried via
the "config.cache_oblivious" mallctl.
- Micro-optimize the fast paths for the public API functions.
- Refactor thread-specific data to reside in a single structure. This assures
that only a single TLS read is necessary per call into the public API.
- Implement in-place huge allocation growing and shrinking.
- Refactor rtree (radix tree for chunk lookups) to be lock-free, and make
additional optimizations that reduce maximum lookup depth to one or two
levels. This resolves what was a concurrency bottleneck for per arena huge
allocation, because a global data structure is critical for determining
which arenas own which huge allocations.

Incompatible changes:
- Replace --enable-cc-silence with --disable-cc-silence to suppress spurious
warnings by default.
- Assure that the constness of malloc_usable_size()'s return type matches that
of the system implementation.
- Change the heap profile dump format to support per thread heap profiling,
rename pprof to jeprof, and enhance it with the --thread=<n> option. As a
result, the bundled jeprof must now be used rather than the upstream
(gperftools) pprof.
- Disable "opt.prof_final" by default, in order to avoid atexit(3), which can
internally deadlock on some platforms.
- Change the "arenas.nlruns" mallctl type from size_t to unsigned.
- Replace the "stats.arenas.<i>.bins.<j>.allocated" mallctl with
"stats.arenas.<i>.bins.<j>.curregs".
- Ignore MALLOC_CONF in set{uid,gid,cap} binaries.
- Ignore MALLOCX_ARENA(a) in dallocx(), in favor of using the
MALLOCX_TCACHE(tc) and MALLOCX_TCACHE_NONE flags to control tcache usage.

Removed features:
- Remove the *allocm() API, which is superseded by the *allocx() API.
- Remove the --enable-dss options, and make dss non-optional on all platforms
which support sbrk(2).
- Remove the "arenas.purge" mallctl, which was obsoleted by the
"arena.<i>.purge" mallctl in 3.1.0.
- Remove the unnecessary "opt.valgrind" mallctl; jemalloc automatically
detects whether it is running inside Valgrind.
- Remove the "stats.huge.allocated", "stats.huge.nmalloc", and
"stats.huge.ndalloc" mallctls.
- Remove the --enable-mremap option.
- Remove the "stats.chunks.current", "stats.chunks.total", and
"stats.chunks.high" mallctls.

Bug fixes:
- Fix the cactive statistic to decrease (rather than increase) when active
memory decreases. This regression was first released in 3.5.0.
- Fix OOM handling in memalign() and valloc(). A variant of this bug existed
in all releases since 2.0.0, which introduced these functions.
- Fix an OOM-related regression in arena_tcache_fill_small(), which could
cause cache corruption on OOM. This regression was present in all releases
from 2.2.0 through 3.6.0.
- Fix size class overflow handling for malloc(), posix_memalign(), memalign(),
calloc(), and realloc() when profiling is enabled.
- Fix the "arena.<i>.dss" mallctl to return an error if "primary" or
"secondary" precedence is specified, but sbrk(2) is not supported.
- Fix fallback lg_floor() implementations to handle extremely large inputs.
- Ensure the default purgeable zone is after the default zone on OS X.
- Fix latent bugs in atomic_*().
- Fix the "arena.<i>.dss" mallctl to handle read-only calls.
- Fix tls_model configuration to enable the initial-exec model when possible.
- Mark malloc_conf as a weak symbol so that the application can override it.
- Correctly detect glibc's adaptive pthread mutexes.
- Fix the --without-export configure option.

* 3.6.0 (March 31, 2014)

This version contains a critical bug fix for a regression present in 3.5.0 and
Expand All @@ -21,7 +261,7 @@ found in the git revision history:
backtracing to be reliable.
- Use dss allocation precedence for huge allocations as well as small/large
allocations.
- Fix test assertion failure message formatting. This bug did not manifect on
- Fix test assertion failure message formatting. This bug did not manifest on
x86_64 systems because of implementation subtleties in va_list.
- Fix inconsequential test failures for hash and SFMT code.

Expand Down Expand Up @@ -516,7 +756,7 @@ found in the git revision history:
- Make it possible for the application to manually flush a thread's cache, via
the "tcache.flush" mallctl.
- Base maximum dirty page count on proportion of active memory.
- Compute various addtional run-time statistics, including per size class
- Compute various additional run-time statistics, including per size class
statistics for large objects.
- Expose malloc_stats_print(), which can be called repeatedly by the
application.
Expand Down
Loading