xref: /netbsd-src/external/bsd/jemalloc/dist/ChangeLog (revision 7bdf38e5b7a28439665f2fdeff81e36913eef7dd)
1a0698ed9SchristosFollowing are change highlights associated with official releases.  Important
2a0698ed9Schristosbug fixes are all mentioned, but some internal enhancements are omitted here for
3a0698ed9Schristosbrevity.  Much more detail can be found in the git revision history:
4a0698ed9Schristos
5a0698ed9Schristos    https://github.com/jemalloc/jemalloc
6a0698ed9Schristos
7*7bdf38e5Schristos* 5.3.0 (May 6, 2022)
8*7bdf38e5Schristos
9*7bdf38e5Schristos  This release contains many speed and space optimizations, from micro
10*7bdf38e5Schristos  optimizations on common paths to rework of internal data structures and
11*7bdf38e5Schristos  locking schemes, and many more too detailed to list below.  Multiple percent
12*7bdf38e5Schristos  of system level metric improvements were measured in tested production
13*7bdf38e5Schristos  workloads.  The release has gone through large-scale production testing.
14*7bdf38e5Schristos
15*7bdf38e5Schristos  New features:
16*7bdf38e5Schristos  - Add the thread.idle mallctl which hints that the calling thread will be
17*7bdf38e5Schristos    idle for a nontrivial period of time.  (@davidtgoldblatt)
18*7bdf38e5Schristos  - Allow small size classes to be the maximum size class to cache in the
19*7bdf38e5Schristos    thread-specific cache, through the opt.[lg_]tcache_max option.  (@interwq,
20*7bdf38e5Schristos    @jordalgo)
21*7bdf38e5Schristos  - Make the behavior of realloc(ptr, 0) configurable with opt.zero_realloc.
22*7bdf38e5Schristos    (@davidtgoldblatt)
23*7bdf38e5Schristos  - Add 'make uninstall' support.  (@sangshuduo, @Lapenkov)
24*7bdf38e5Schristos  - Support C++17 over-aligned allocation.  (@marksantaniello)
25*7bdf38e5Schristos  - Add the thread.peak mallctl for approximate per-thread peak memory tracking.
26*7bdf38e5Schristos    (@davidtgoldblatt)
27*7bdf38e5Schristos  - Add interval-based stats output opt.stats_interval.  (@interwq)
28*7bdf38e5Schristos  - Add prof.prefix to override filename prefixes for dumps.  (@zhxchen17)
29*7bdf38e5Schristos  - Add high resolution timestamp support for profiling.  (@tyroguru)
30*7bdf38e5Schristos  - Add the --collapsed flag to jeprof for flamegraph generation.
31*7bdf38e5Schristos    (@igorwwwwwwwwwwwwwwwwwwww)
32*7bdf38e5Schristos  - Add the --debug-syms-by-id option to jeprof for debug symbols discovery.
33*7bdf38e5Schristos    (@DeannaGelbart)
34*7bdf38e5Schristos  - Add the opt.prof_leak_error option to exit with error code when leak is
35*7bdf38e5Schristos    detected using opt.prof_final.  (@yunxuo)
36*7bdf38e5Schristos  - Add opt.cache_oblivious as an runtime alternative to config.cache_oblivious.
37*7bdf38e5Schristos    (@interwq)
38*7bdf38e5Schristos  - Add mallctl interfaces:
39*7bdf38e5Schristos    + opt.zero_realloc  (@davidtgoldblatt)
40*7bdf38e5Schristos    + opt.cache_oblivious  (@interwq)
41*7bdf38e5Schristos    + opt.prof_leak_error  (@yunxuo)
42*7bdf38e5Schristos    + opt.stats_interval  (@interwq)
43*7bdf38e5Schristos    + opt.stats_interval_opts  (@interwq)
44*7bdf38e5Schristos    + opt.tcache_max  (@interwq)
45*7bdf38e5Schristos    + opt.trust_madvise  (@azat)
46*7bdf38e5Schristos    + prof.prefix  (@zhxchen17)
47*7bdf38e5Schristos    + stats.zero_reallocs  (@davidtgoldblatt)
48*7bdf38e5Schristos    + thread.idle  (@davidtgoldblatt)
49*7bdf38e5Schristos    + thread.peak.{read,reset}  (@davidtgoldblatt)
50*7bdf38e5Schristos
51*7bdf38e5Schristos  Bug fixes:
52*7bdf38e5Schristos  - Fix the synchronization around explicit tcache creation which could cause
53*7bdf38e5Schristos    invalid tcache identifiers.  This regression was first released in 5.0.0.
54*7bdf38e5Schristos    (@yoshinorim, @davidtgoldblatt)
55*7bdf38e5Schristos  - Fix a profiling biasing issue which could cause incorrect heap usage and
56*7bdf38e5Schristos    object counts.  This issue existed in all previous releases with the heap
57*7bdf38e5Schristos    profiling feature.  (@davidtgoldblatt)
58*7bdf38e5Schristos  - Fix the order of stats counter updating on large realloc which could cause
59*7bdf38e5Schristos    failed assertions.  This regression was first released in 5.0.0.  (@azat)
60*7bdf38e5Schristos  - Fix the locking on the arena destroy mallctl, which could cause concurrent
61*7bdf38e5Schristos    arena creations to fail.  This functionality was first introduced in 5.0.0.
62*7bdf38e5Schristos    (@interwq)
63*7bdf38e5Schristos
64*7bdf38e5Schristos  Portability improvements:
65*7bdf38e5Schristos  - Remove nothrow from system function declarations on macOS and FreeBSD.
66*7bdf38e5Schristos    (@davidtgoldblatt, @fredemmott, @leres)
67*7bdf38e5Schristos  - Improve overcommit and page alignment settings on NetBSD.  (@zoulasc)
68*7bdf38e5Schristos  - Improve CPU affinity support on BSD platforms.  (@devnexen)
69*7bdf38e5Schristos  - Improve utrace detection and support.  (@devnexen)
70*7bdf38e5Schristos  - Improve QEMU support with MADV_DONTNEED zeroed pages detection.  (@azat)
71*7bdf38e5Schristos  - Add memcntl support on Solaris / illumos.  (@devnexen)
72*7bdf38e5Schristos  - Improve CPU_SPINWAIT on ARM.  (@AWSjswinney)
73*7bdf38e5Schristos  - Improve TSD cleanup on FreeBSD.  (@Lapenkov)
74*7bdf38e5Schristos  - Disable percpu_arena if the CPU count cannot be reliably detected.  (@azat)
75*7bdf38e5Schristos  - Add malloc_size(3) override support.  (@devnexen)
76*7bdf38e5Schristos  - Add mmap VM_MAKE_TAG support.  (@devnexen)
77*7bdf38e5Schristos  - Add support for MADV_[NO]CORE.  (@devnexen)
78*7bdf38e5Schristos  - Add support for DragonFlyBSD.  (@devnexen)
79*7bdf38e5Schristos  - Fix the QUANTUM setting on MIPS64.  (@brooksdavis)
80*7bdf38e5Schristos  - Add the QUANTUM setting for ARC.  (@vineetgarc)
81*7bdf38e5Schristos  - Add the QUANTUM setting for LoongArch.  (@wangjl-uos)
82*7bdf38e5Schristos  - Add QNX support.  (@jqian-aurora)
83*7bdf38e5Schristos  - Avoid atexit(3) calls unless the relevant profiling features are enabled.
84*7bdf38e5Schristos    (@BusyJay, @laiwei-rice, @interwq)
85*7bdf38e5Schristos  - Fix unknown option detection when using Clang.  (@Lapenkov)
86*7bdf38e5Schristos  - Fix symbol conflict with musl libc.  (@georgthegreat)
87*7bdf38e5Schristos  - Add -Wimplicit-fallthrough checks.  (@nickdesaulniers)
88*7bdf38e5Schristos  - Add __forceinline support on MSVC.  (@santagada)
89*7bdf38e5Schristos  - Improve FreeBSD and Windows CI support.  (@Lapenkov)
90*7bdf38e5Schristos  - Add CI support for PPC64LE architecture.  (@ezeeyahoo)
91*7bdf38e5Schristos
92*7bdf38e5Schristos  Incompatible changes:
93*7bdf38e5Schristos  - Maximum size class allowed in tcache (opt.[lg_]tcache_max) now has an upper
94*7bdf38e5Schristos    bound of 8MiB.  (@interwq)
95*7bdf38e5Schristos
96*7bdf38e5Schristos  Optimizations and refactors (@davidtgoldblatt, @Lapenkov, @interwq):
97*7bdf38e5Schristos  - Optimize the common cases of the thread cache operations.
98*7bdf38e5Schristos  - Optimize internal data structures, including RB tree and pairing heap.
99*7bdf38e5Schristos  - Optimize the internal locking on extent management.
100*7bdf38e5Schristos  - Extract and refactor the internal page allocator and interface modules.
101*7bdf38e5Schristos
102*7bdf38e5Schristos  Documentation:
103*7bdf38e5Schristos  - Fix doc build with --with-install-suffix.  (@lawmurray, @interwq)
104*7bdf38e5Schristos  - Add PROFILING_INTERNALS.md.  (@davidtgoldblatt)
105*7bdf38e5Schristos  - Ensure the proper order of doc building and installation.  (@Mingli-Yu)
106*7bdf38e5Schristos
107*7bdf38e5Schristos* 5.2.1 (August 5, 2019)
108*7bdf38e5Schristos
109*7bdf38e5Schristos  This release is primarily about Windows.  A critical virtual memory leak is
110*7bdf38e5Schristos  resolved on all Windows platforms.  The regression was present in all releases
111*7bdf38e5Schristos  since 5.0.0.
112*7bdf38e5Schristos
113*7bdf38e5Schristos  Bug fixes:
114*7bdf38e5Schristos  - Fix a severe virtual memory leak on Windows.  This regression was first
115*7bdf38e5Schristos    released in 5.0.0.  (@Ignition, @j0t, @frederik-h, @davidtgoldblatt,
116*7bdf38e5Schristos    @interwq)
117*7bdf38e5Schristos  - Fix size 0 handling in posix_memalign().  This regression was first released
118*7bdf38e5Schristos    in 5.2.0.  (@interwq)
119*7bdf38e5Schristos  - Fix the prof_log unit test which may observe unexpected backtraces from
120*7bdf38e5Schristos    compiler optimizations.  The test was first added in 5.2.0.  (@marxin,
121*7bdf38e5Schristos    @gnzlbg, @interwq)
122*7bdf38e5Schristos  - Fix the declaration of the extent_avail tree.  This regression was first
123*7bdf38e5Schristos    released in 5.1.0.  (@zoulasc)
124*7bdf38e5Schristos  - Fix an incorrect reference in jeprof.  This functionality was first released
125*7bdf38e5Schristos    in 3.0.0.  (@prehistoric-penguin)
126*7bdf38e5Schristos  - Fix an assertion on the deallocation fast-path.  This regression was first
127*7bdf38e5Schristos    released in 5.2.0.  (@yinan1048576)
128*7bdf38e5Schristos  - Fix the TLS_MODEL attribute in headers.  This regression was first released
129*7bdf38e5Schristos    in 5.0.0.  (@zoulasc, @interwq)
130*7bdf38e5Schristos
131*7bdf38e5Schristos  Optimizations and refactors:
132*7bdf38e5Schristos  - Implement opt.retain on Windows and enable by default on 64-bit.  (@interwq,
133*7bdf38e5Schristos    @davidtgoldblatt)
134*7bdf38e5Schristos  - Optimize away a branch on the operator delete[] path.  (@mgrice)
135*7bdf38e5Schristos  - Add format annotation to the format generator function.  (@zoulasc)
136*7bdf38e5Schristos  - Refactor and improve the size class header generation.  (@yinan1048576)
137*7bdf38e5Schristos  - Remove best fit.  (@djwatson)
138*7bdf38e5Schristos  - Avoid blocking on background thread locks for stats.  (@oranagra, @interwq)
139*7bdf38e5Schristos
140*7bdf38e5Schristos* 5.2.0 (April 2, 2019)
141*7bdf38e5Schristos
142*7bdf38e5Schristos  This release includes a few notable improvements, which are summarized below:
143*7bdf38e5Schristos  1) improved fast-path performance from the optimizations by @djwatson; 2)
144*7bdf38e5Schristos  reduced virtual memory fragmentation and metadata usage; and 3) bug fixes on
145*7bdf38e5Schristos  setting the number of background threads.  In addition, peak / spike memory
146*7bdf38e5Schristos  usage is improved with certain allocation patterns.  As usual, the release and
147*7bdf38e5Schristos  prior dev versions have gone through large-scale production testing.
148*7bdf38e5Schristos
149*7bdf38e5Schristos  New features:
150*7bdf38e5Schristos  - Implement oversize_threshold, which uses a dedicated arena for allocations
151*7bdf38e5Schristos    crossing the specified threshold to reduce fragmentation.  (@interwq)
152*7bdf38e5Schristos  - Add extents usage information to stats.  (@tyleretzel)
153*7bdf38e5Schristos  - Log time information for sampled allocations.  (@tyleretzel)
154*7bdf38e5Schristos  - Support 0 size in sdallocx.  (@djwatson)
155*7bdf38e5Schristos  - Output rate for certain counters in malloc_stats.  (@zinoale)
156*7bdf38e5Schristos  - Add configure option --enable-readlinkat, which allows the use of readlinkat
157*7bdf38e5Schristos    over readlink.  (@davidtgoldblatt)
158*7bdf38e5Schristos  - Add configure options --{enable,disable}-{static,shared} to allow not
159*7bdf38e5Schristos    building unwanted libraries.  (@Ericson2314)
160*7bdf38e5Schristos  - Add configure option --disable-libdl to enable fully static builds.
161*7bdf38e5Schristos    (@interwq)
162*7bdf38e5Schristos  - Add mallctl interfaces:
163*7bdf38e5Schristos	+ opt.oversize_threshold (@interwq)
164*7bdf38e5Schristos	+ stats.arenas.<i>.extent_avail (@tyleretzel)
165*7bdf38e5Schristos	+ stats.arenas.<i>.extents.<j>.n{dirty,muzzy,retained} (@tyleretzel)
166*7bdf38e5Schristos	+ stats.arenas.<i>.extents.<j>.{dirty,muzzy,retained}_bytes
167*7bdf38e5Schristos	  (@tyleretzel)
168*7bdf38e5Schristos
169*7bdf38e5Schristos  Portability improvements:
170*7bdf38e5Schristos  - Update MSVC builds.  (@maksqwe, @rustyx)
171*7bdf38e5Schristos  - Workaround a compiler optimizer bug on s390x.  (@rkmisra)
172*7bdf38e5Schristos  - Make use of pthread_set_name_np(3) on FreeBSD.  (@trasz)
173*7bdf38e5Schristos  - Implement malloc_getcpu() to enable percpu_arena for windows.  (@santagada)
174*7bdf38e5Schristos  - Link against -pthread instead of -lpthread.  (@paravoid)
175*7bdf38e5Schristos  - Make background_thread not dependent on libdl.  (@interwq)
176*7bdf38e5Schristos  - Add stringify to fix a linker directive issue on MSVC.  (@daverigby)
177*7bdf38e5Schristos  - Detect and fall back when 8-bit atomics are unavailable.  (@interwq)
178*7bdf38e5Schristos  - Fall back to the default pthread_create if dlsym(3) fails.  (@interwq)
179*7bdf38e5Schristos
180*7bdf38e5Schristos  Optimizations and refactors:
181*7bdf38e5Schristos  - Refactor the TSD module.  (@davidtgoldblatt)
182*7bdf38e5Schristos  - Avoid taking extents_muzzy mutex when muzzy is disabled.  (@interwq)
183*7bdf38e5Schristos  - Avoid taking large_mtx for auto arenas on the tcache flush path.  (@interwq)
184*7bdf38e5Schristos  - Optimize ixalloc by avoiding a size lookup.  (@interwq)
185*7bdf38e5Schristos  - Implement opt.oversize_threshold which uses a dedicated arena for requests
186*7bdf38e5Schristos    crossing the threshold, also eagerly purges the oversize extents.  Default
187*7bdf38e5Schristos    the threshold to 8 MiB.  (@interwq)
188*7bdf38e5Schristos  - Clean compilation with -Wextra.  (@gnzlbg, @jasone)
189*7bdf38e5Schristos  - Refactor the size class module.  (@davidtgoldblatt)
190*7bdf38e5Schristos  - Refactor the stats emitter.  (@tyleretzel)
191*7bdf38e5Schristos  - Optimize pow2_ceil.  (@rkmisra)
192*7bdf38e5Schristos  - Avoid runtime detection of lazy purging on FreeBSD.  (@trasz)
193*7bdf38e5Schristos  - Optimize mmap(2) alignment handling on FreeBSD.  (@trasz)
194*7bdf38e5Schristos  - Improve error handling for THP state initialization.  (@jsteemann)
195*7bdf38e5Schristos  - Rework the malloc() fast path.  (@djwatson)
196*7bdf38e5Schristos  - Rework the free() fast path.  (@djwatson)
197*7bdf38e5Schristos  - Refactor and optimize the tcache fill / flush paths.  (@djwatson)
198*7bdf38e5Schristos  - Optimize sync / lwsync on PowerPC.  (@chmeeedalf)
199*7bdf38e5Schristos  - Bypass extent_dalloc() when retain is enabled.  (@interwq)
200*7bdf38e5Schristos  - Optimize the locking on large deallocation.  (@interwq)
201*7bdf38e5Schristos  - Reduce the number of pages committed from sanity checking in debug build.
202*7bdf38e5Schristos    (@trasz, @interwq)
203*7bdf38e5Schristos  - Deprecate OSSpinLock.  (@interwq)
204*7bdf38e5Schristos  - Lower the default number of background threads to 4 (when the feature
205*7bdf38e5Schristos    is enabled).  (@interwq)
206*7bdf38e5Schristos  - Optimize the trylock spin wait.  (@djwatson)
207*7bdf38e5Schristos  - Use arena index for arena-matching checks.  (@interwq)
208*7bdf38e5Schristos  - Avoid forced decay on thread termination when using background threads.
209*7bdf38e5Schristos    (@interwq)
210*7bdf38e5Schristos  - Disable muzzy decay by default.  (@djwatson, @interwq)
211*7bdf38e5Schristos  - Only initialize libgcc unwinder when profiling is enabled.  (@paravoid,
212*7bdf38e5Schristos    @interwq)
213*7bdf38e5Schristos
214*7bdf38e5Schristos  Bug fixes (all only relevant to jemalloc 5.x):
215*7bdf38e5Schristos  - Fix background thread index issues with max_background_threads.  (@djwatson,
216*7bdf38e5Schristos    @interwq)
217*7bdf38e5Schristos  - Fix stats output for opt.lg_extent_max_active_fit.  (@interwq)
218*7bdf38e5Schristos  - Fix opt.prof_prefix initialization.  (@davidtgoldblatt)
219*7bdf38e5Schristos  - Properly trigger decay on tcache destroy.  (@interwq, @amosbird)
220*7bdf38e5Schristos  - Fix tcache.flush.  (@interwq)
221*7bdf38e5Schristos  - Detect whether explicit extent zero out is necessary with huge pages or
222*7bdf38e5Schristos    custom extent hooks, which may change the purge semantics.  (@interwq)
223*7bdf38e5Schristos  - Fix a side effect caused by extent_max_active_fit combined with decay-based
224*7bdf38e5Schristos    purging, where freed extents can accumulate and not be reused for an
225*7bdf38e5Schristos    extended period of time.  (@interwq, @mpghf)
226*7bdf38e5Schristos  - Fix a missing unlock on extent register error handling.  (@zoulasc)
227*7bdf38e5Schristos
228*7bdf38e5Schristos  Testing:
229*7bdf38e5Schristos  - Simplify the Travis script output.  (@gnzlbg)
230*7bdf38e5Schristos  - Update the test scripts for FreeBSD.  (@devnexen)
231*7bdf38e5Schristos  - Add unit tests for the producer-consumer pattern.  (@interwq)
232*7bdf38e5Schristos  - Add Cirrus-CI config for FreeBSD builds.  (@jasone)
233*7bdf38e5Schristos  - Add size-matching sanity checks on tcache flush.  (@davidtgoldblatt,
234*7bdf38e5Schristos    @interwq)
235*7bdf38e5Schristos
236*7bdf38e5Schristos  Incompatible changes:
237*7bdf38e5Schristos  - Remove --with-lg-page-sizes.  (@davidtgoldblatt)
238*7bdf38e5Schristos
239*7bdf38e5Schristos  Documentation:
240*7bdf38e5Schristos  - Attempt to build docs by default, however skip doc building when xsltproc
241*7bdf38e5Schristos    is missing. (@interwq, @cmuellner)
242*7bdf38e5Schristos
243*7bdf38e5Schristos* 5.1.0 (May 4, 2018)
244a0698ed9Schristos
245a0698ed9Schristos  This release is primarily about fine-tuning, ranging from several new features
246a0698ed9Schristos  to numerous notable performance and portability enhancements.  The release and
247a0698ed9Schristos  prior dev versions have been running in multiple large scale applications for
248a0698ed9Schristos  months, and the cumulative improvements are substantial in many cases.
249a0698ed9Schristos
250a0698ed9Schristos  Given the long and successful production runs, this release is likely a good
251a0698ed9Schristos  candidate for applications to upgrade, from both jemalloc 5.0 and before.  For
252a0698ed9Schristos  performance-critical applications, the newly added TUNING.md provides
253a0698ed9Schristos  guidelines on jemalloc tuning.
254a0698ed9Schristos
255a0698ed9Schristos  New features:
256a0698ed9Schristos  - Implement transparent huge page support for internal metadata.  (@interwq)
257a0698ed9Schristos  - Add opt.thp to allow enabling / disabling transparent huge pages for all
258a0698ed9Schristos    mappings.  (@interwq)
259a0698ed9Schristos  - Add maximum background thread count option.  (@djwatson)
260a0698ed9Schristos  - Allow prof_active to control opt.lg_prof_interval and prof.gdump.
261a0698ed9Schristos    (@interwq)
262a0698ed9Schristos  - Allow arena index lookup based on allocation addresses via mallctl.
263a0698ed9Schristos    (@lionkov)
264a0698ed9Schristos  - Allow disabling initial-exec TLS model.  (@davidtgoldblatt, @KenMacD)
265a0698ed9Schristos  - Add opt.lg_extent_max_active_fit to set the max ratio between the size of
266a0698ed9Schristos    the active extent selected (to split off from) and the size of the requested
267a0698ed9Schristos    allocation.  (@interwq, @davidtgoldblatt)
268a0698ed9Schristos  - Add retain_grow_limit to set the max size when growing virtual address
269a0698ed9Schristos    space.  (@interwq)
270a0698ed9Schristos  - Add mallctl interfaces:
271a0698ed9Schristos    + arena.<i>.retain_grow_limit  (@interwq)
272a0698ed9Schristos    + arenas.lookup  (@lionkov)
273a0698ed9Schristos    + max_background_threads  (@djwatson)
274a0698ed9Schristos    + opt.lg_extent_max_active_fit  (@interwq)
275a0698ed9Schristos    + opt.max_background_threads  (@djwatson)
276a0698ed9Schristos    + opt.metadata_thp  (@interwq)
277a0698ed9Schristos    + opt.thp  (@interwq)
278a0698ed9Schristos    + stats.metadata_thp  (@interwq)
279a0698ed9Schristos
280a0698ed9Schristos  Portability improvements:
281a0698ed9Schristos  - Support GNU/kFreeBSD configuration.  (@paravoid)
282a0698ed9Schristos  - Support m68k, nios2 and SH3 architectures.  (@paravoid)
283a0698ed9Schristos  - Fall back to FD_CLOEXEC when O_CLOEXEC is unavailable.  (@zonyitoo)
284a0698ed9Schristos  - Fix symbol listing for cross-compiling.  (@tamird)
285a0698ed9Schristos  - Fix high bits computation on ARM.  (@davidtgoldblatt, @paravoid)
286a0698ed9Schristos  - Disable the CPU_SPINWAIT macro for Power.  (@davidtgoldblatt, @marxin)
287a0698ed9Schristos  - Fix MSVC 2015 & 2017 builds.  (@rustyx)
288a0698ed9Schristos  - Improve RISC-V support.  (@EdSchouten)
289a0698ed9Schristos  - Set name mangling script in strict mode.  (@nicolov)
290a0698ed9Schristos  - Avoid MADV_HUGEPAGE on ARM.  (@marxin)
291a0698ed9Schristos  - Modify configure to determine return value of strerror_r.
292a0698ed9Schristos    (@davidtgoldblatt, @cferris1000)
293a0698ed9Schristos  - Make sure CXXFLAGS is tested with CPP compiler.  (@nehaljwani)
294a0698ed9Schristos  - Fix 32-bit build on MSVC.  (@rustyx)
295a0698ed9Schristos  - Fix external symbol on MSVC.  (@maksqwe)
296a0698ed9Schristos  - Avoid a printf format specifier warning.  (@jasone)
297a0698ed9Schristos  - Add configure option --disable-initial-exec-tls which can allow jemalloc to
298a0698ed9Schristos    be dynamically loaded after program startup.  (@davidtgoldblatt, @KenMacD)
299a0698ed9Schristos  - AArch64: Add ILP32 support.  (@cmuellner)
300a0698ed9Schristos  - Add --with-lg-vaddr configure option to support cross compiling.
301a0698ed9Schristos    (@cmuellner, @davidtgoldblatt)
302a0698ed9Schristos
303a0698ed9Schristos  Optimizations and refactors:
304a0698ed9Schristos  - Improve active extent fit with extent_max_active_fit.  This considerably
305a0698ed9Schristos    reduces fragmentation over time and improves virtual memory and metadata
306a0698ed9Schristos    usage.  (@davidtgoldblatt, @interwq)
307a0698ed9Schristos  - Eagerly coalesce large extents to reduce fragmentation.  (@interwq)
308a0698ed9Schristos  - sdallocx: only read size info when page aligned (i.e. possibly sampled),
309a0698ed9Schristos    which speeds up the sized deallocation path significantly.  (@interwq)
310a0698ed9Schristos  - Avoid attempting new mappings for in place expansion with retain, since
311a0698ed9Schristos    it rarely succeeds in practice and causes high overhead.  (@interwq)
312a0698ed9Schristos  - Refactor OOM handling in newImpl.  (@wqfish)
313a0698ed9Schristos  - Add internal fine-grained logging functionality for debugging use.
314a0698ed9Schristos    (@davidtgoldblatt)
315a0698ed9Schristos  - Refactor arena / tcache interactions.  (@davidtgoldblatt)
316a0698ed9Schristos  - Refactor extent management with dumpable flag.  (@davidtgoldblatt)
317a0698ed9Schristos  - Add runtime detection of lazy purging.  (@interwq)
318a0698ed9Schristos  - Use pairing heap instead of red-black tree for extents_avail.  (@djwatson)
319a0698ed9Schristos  - Use sysctl on startup in FreeBSD.  (@trasz)
320a0698ed9Schristos  - Use thread local prng state instead of atomic.  (@djwatson)
321a0698ed9Schristos  - Make decay to always purge one more extent than before, because in
322a0698ed9Schristos    practice large extents are usually the ones that cross the decay threshold.
323a0698ed9Schristos    Purging the additional extent helps save memory as well as reduce VM
324a0698ed9Schristos    fragmentation.  (@interwq)
325a0698ed9Schristos  - Fast division by dynamic values.  (@davidtgoldblatt)
326a0698ed9Schristos  - Improve the fit for aligned allocation.  (@interwq, @edwinsmith)
327a0698ed9Schristos  - Refactor extent_t bitpacking.  (@rkmisra)
328a0698ed9Schristos  - Optimize the generated assembly for ticker operations.  (@davidtgoldblatt)
329a0698ed9Schristos  - Convert stats printing to use a structured text emitter.  (@davidtgoldblatt)
330a0698ed9Schristos  - Remove preserve_lru feature for extents management.  (@djwatson)
331a0698ed9Schristos  - Consolidate two memory loads into one on the fast deallocation path.
332a0698ed9Schristos    (@davidtgoldblatt, @interwq)
333a0698ed9Schristos
334a0698ed9Schristos  Bug fixes (most of the issues are only relevant to jemalloc 5.0):
335a0698ed9Schristos  - Fix deadlock with multithreaded fork in OS X.  (@davidtgoldblatt)
336a0698ed9Schristos  - Validate returned file descriptor before use.  (@zonyitoo)
337a0698ed9Schristos  - Fix a few background thread initialization and shutdown issues.  (@interwq)
338a0698ed9Schristos  - Fix an extent coalesce + decay race by taking both coalescing extents off
339a0698ed9Schristos    the LRU list.  (@interwq)
340a0698ed9Schristos  - Fix potentially unbound increase during decay, caused by one thread keep
341a0698ed9Schristos    stashing memory to purge while other threads generating new pages.  The
342a0698ed9Schristos    number of pages to purge is checked to prevent this.  (@interwq)
343a0698ed9Schristos  - Fix a FreeBSD bootstrap assertion.  (@strejda, @interwq)
344a0698ed9Schristos  - Handle 32 bit mutex counters.  (@rkmisra)
345a0698ed9Schristos  - Fix a indexing bug when creating background threads.  (@davidtgoldblatt,
346a0698ed9Schristos    @binliu19)
347a0698ed9Schristos  - Fix arguments passed to extent_init.  (@yuleniwo, @interwq)
348a0698ed9Schristos  - Fix addresses used for ordering mutexes.  (@rkmisra)
349a0698ed9Schristos  - Fix abort_conf processing during bootstrap.  (@interwq)
350a0698ed9Schristos  - Fix include path order for out-of-tree builds.  (@cmuellner)
351a0698ed9Schristos
352a0698ed9Schristos  Incompatible changes:
353a0698ed9Schristos  - Remove --disable-thp.  (@interwq)
354a0698ed9Schristos  - Remove mallctl interfaces:
355a0698ed9Schristos    + config.thp  (@interwq)
356a0698ed9Schristos
357a0698ed9Schristos  Documentation:
358a0698ed9Schristos  - Add TUNING.md.  (@interwq, @davidtgoldblatt, @djwatson)
359a0698ed9Schristos
360a0698ed9Schristos* 5.0.1 (July 1, 2017)
361a0698ed9Schristos
362a0698ed9Schristos  This bugfix release fixes several issues, most of which are obscure enough
363a0698ed9Schristos  that typical applications are not impacted.
364a0698ed9Schristos
365a0698ed9Schristos  Bug fixes:
366a0698ed9Schristos  - Update decay->nunpurged before purging, in order to avoid potential update
367a0698ed9Schristos    races and subsequent incorrect purging volume.  (@interwq)
368a0698ed9Schristos  - Only abort on dlsym(3) error if the failure impacts an enabled feature (lazy
369a0698ed9Schristos    locking and/or background threads).  This mitigates an initialization
370a0698ed9Schristos    failure bug for which we still do not have a clear reproduction test case.
371a0698ed9Schristos    (@interwq)
372a0698ed9Schristos  - Modify tsd management so that it neither crashes nor leaks if a thread's
373a0698ed9Schristos    only allocation activity is to call free() after TLS destructors have been
374a0698ed9Schristos    executed.  This behavior was observed when operating with GNU libc, and is
375a0698ed9Schristos    unlikely to be an issue with other libc implementations.  (@interwq)
376a0698ed9Schristos  - Mask signals during background thread creation.  This prevents signals from
377a0698ed9Schristos    being inadvertently delivered to background threads.  (@jasone,
378a0698ed9Schristos    @davidtgoldblatt, @interwq)
379a0698ed9Schristos  - Avoid inactivity checks within background threads, in order to prevent
380a0698ed9Schristos    recursive mutex acquisition.  (@interwq)
381a0698ed9Schristos  - Fix extent_grow_retained() to use the specified hooks when the
382a0698ed9Schristos    arena.<i>.extent_hooks mallctl is used to override the default hooks.
383a0698ed9Schristos    (@interwq)
384a0698ed9Schristos  - Add missing reentrancy support for custom extent hooks which allocate.
385a0698ed9Schristos    (@interwq)
386a0698ed9Schristos  - Post-fork(2), re-initialize the list of tcaches associated with each arena
387a0698ed9Schristos    to contain no tcaches except the forking thread's.  (@interwq)
388a0698ed9Schristos  - Add missing post-fork(2) mutex reinitialization for extent_grow_mtx.  This
389a0698ed9Schristos    fixes potential deadlocks after fork(2).  (@interwq)
390a0698ed9Schristos  - Enforce minimum autoconf version (currently 2.68), since 2.63 is known to
391a0698ed9Schristos    generate corrupt configure scripts.  (@jasone)
392a0698ed9Schristos  - Ensure that the configured page size (--with-lg-page) is no larger than the
393a0698ed9Schristos    configured huge page size (--with-lg-hugepage).  (@jasone)
394a0698ed9Schristos
395a0698ed9Schristos* 5.0.0 (June 13, 2017)
396a0698ed9Schristos
397a0698ed9Schristos  Unlike all previous jemalloc releases, this release does not use naturally
398a0698ed9Schristos  aligned "chunks" for virtual memory management, and instead uses page-aligned
399a0698ed9Schristos  "extents".  This change has few externally visible effects, but the internal
400a0698ed9Schristos  impacts are... extensive.  Many other internal changes combine to make this
401a0698ed9Schristos  the most cohesively designed version of jemalloc so far, with ample
402a0698ed9Schristos  opportunity for further enhancements.
403a0698ed9Schristos
404a0698ed9Schristos  Continuous integration is now an integral aspect of development thanks to the
405a0698ed9Schristos  efforts of @davidtgoldblatt, and the dev branch tends to remain reasonably
406a0698ed9Schristos  stable on the tested platforms (Linux, FreeBSD, macOS, and Windows).  As a
407a0698ed9Schristos  side effect the official release frequency may decrease over time.
408a0698ed9Schristos
409a0698ed9Schristos  New features:
410a0698ed9Schristos  - Implement optional per-CPU arena support; threads choose which arena to use
411a0698ed9Schristos    based on current CPU rather than on fixed thread-->arena associations.
412a0698ed9Schristos    (@interwq)
413a0698ed9Schristos  - Implement two-phase decay of unused dirty pages.  Pages transition from
414a0698ed9Schristos    dirty-->muzzy-->clean, where the first phase transition relies on
415a0698ed9Schristos    madvise(... MADV_FREE) semantics, and the second phase transition discards
416a0698ed9Schristos    pages such that they are replaced with demand-zeroed pages on next access.
417a0698ed9Schristos    (@jasone)
418a0698ed9Schristos  - Increase decay time resolution from seconds to milliseconds.  (@jasone)
419a0698ed9Schristos  - Implement opt-in per CPU background threads, and use them for asynchronous
420a0698ed9Schristos    decay-driven unused dirty page purging.  (@interwq)
421a0698ed9Schristos  - Add mutex profiling, which collects a variety of statistics useful for
422a0698ed9Schristos    diagnosing overhead/contention issues.  (@interwq)
423a0698ed9Schristos  - Add C++ new/delete operator bindings.  (@djwatson)
424a0698ed9Schristos  - Support manually created arena destruction, such that all data and metadata
425a0698ed9Schristos    are discarded.  Add MALLCTL_ARENAS_DESTROYED for accessing merged stats
426a0698ed9Schristos    associated with destroyed arenas.  (@jasone)
427a0698ed9Schristos  - Add MALLCTL_ARENAS_ALL as a fixed index for use in accessing
428a0698ed9Schristos    merged/destroyed arena statistics via mallctl.  (@jasone)
429a0698ed9Schristos  - Add opt.abort_conf to optionally abort if invalid configuration options are
430a0698ed9Schristos    detected during initialization.  (@interwq)
431a0698ed9Schristos  - Add opt.stats_print_opts, so that e.g. JSON output can be selected for the
432a0698ed9Schristos    stats dumped during exit if opt.stats_print is true.  (@jasone)
433a0698ed9Schristos  - Add --with-version=VERSION for use when embedding jemalloc into another
434a0698ed9Schristos    project's git repository.  (@jasone)
435a0698ed9Schristos  - Add --disable-thp to support cross compiling.  (@jasone)
436a0698ed9Schristos  - Add --with-lg-hugepage to support cross compiling.  (@jasone)
437a0698ed9Schristos  - Add mallctl interfaces (various authors):
438a0698ed9Schristos    + background_thread
439a0698ed9Schristos    + opt.abort_conf
440a0698ed9Schristos    + opt.retain
441a0698ed9Schristos    + opt.percpu_arena
442a0698ed9Schristos    + opt.background_thread
443a0698ed9Schristos    + opt.{dirty,muzzy}_decay_ms
444a0698ed9Schristos    + opt.stats_print_opts
445a0698ed9Schristos    + arena.<i>.initialized
446a0698ed9Schristos    + arena.<i>.destroy
447a0698ed9Schristos    + arena.<i>.{dirty,muzzy}_decay_ms
448a0698ed9Schristos    + arena.<i>.extent_hooks
449a0698ed9Schristos    + arenas.{dirty,muzzy}_decay_ms
450a0698ed9Schristos    + arenas.bin.<i>.slab_size
451a0698ed9Schristos    + arenas.nlextents
452a0698ed9Schristos    + arenas.lextent.<i>.size
453a0698ed9Schristos    + arenas.create
454a0698ed9Schristos    + stats.background_thread.{num_threads,num_runs,run_interval}
455a0698ed9Schristos    + stats.mutexes.{ctl,background_thread,prof,reset}.
456a0698ed9Schristos      {num_ops,num_spin_acq,num_wait,max_wait_time,total_wait_time,max_num_thds,
457a0698ed9Schristos      num_owner_switch}
458a0698ed9Schristos    + stats.arenas.<i>.{dirty,muzzy}_decay_ms
459a0698ed9Schristos    + stats.arenas.<i>.uptime
460a0698ed9Schristos    + stats.arenas.<i>.{pmuzzy,base,internal,resident}
461a0698ed9Schristos    + stats.arenas.<i>.{dirty,muzzy}_{npurge,nmadvise,purged}
462a0698ed9Schristos    + stats.arenas.<i>.bins.<j>.{nslabs,reslabs,curslabs}
463a0698ed9Schristos    + stats.arenas.<i>.bins.<j>.mutex.
464a0698ed9Schristos      {num_ops,num_spin_acq,num_wait,max_wait_time,total_wait_time,max_num_thds,
465a0698ed9Schristos      num_owner_switch}
466a0698ed9Schristos    + stats.arenas.<i>.lextents.<j>.{nmalloc,ndalloc,nrequests,curlextents}
467a0698ed9Schristos    + stats.arenas.i.mutexes.{large,extent_avail,extents_dirty,extents_muzzy,
468a0698ed9Schristos      extents_retained,decay_dirty,decay_muzzy,base,tcache_list}.
469a0698ed9Schristos      {num_ops,num_spin_acq,num_wait,max_wait_time,total_wait_time,max_num_thds,
470a0698ed9Schristos      num_owner_switch}
471a0698ed9Schristos
472a0698ed9Schristos  Portability improvements:
473a0698ed9Schristos  - Improve reentrant allocation support, such that deadlock is less likely if
474a0698ed9Schristos    e.g. a system library call in turn allocates memory.  (@davidtgoldblatt,
475a0698ed9Schristos    @interwq)
476a0698ed9Schristos  - Support static linking of jemalloc with glibc.  (@djwatson)
477a0698ed9Schristos
478a0698ed9Schristos  Optimizations and refactors:
479a0698ed9Schristos  - Organize virtual memory as "extents" of virtual memory pages, rather than as
480a0698ed9Schristos    naturally aligned "chunks", and store all metadata in arbitrarily distant
481a0698ed9Schristos    locations.  This reduces virtual memory external fragmentation, and will
482a0698ed9Schristos    interact better with huge pages (not yet explicitly supported).  (@jasone)
483a0698ed9Schristos  - Fold large and huge size classes together; only small and large size classes
484a0698ed9Schristos    remain.  (@jasone)
485a0698ed9Schristos  - Unify the allocation paths, and merge most fast-path branching decisions.
486a0698ed9Schristos    (@davidtgoldblatt, @interwq)
487a0698ed9Schristos  - Embed per thread automatic tcache into thread-specific data, which reduces
488a0698ed9Schristos    conditional branches and dereferences.  Also reorganize tcache to increase
489a0698ed9Schristos    fast-path data locality.  (@interwq)
490a0698ed9Schristos  - Rewrite atomics to closely model the C11 API, convert various
491a0698ed9Schristos    synchronization from mutex-based to atomic, and use the explicit memory
492a0698ed9Schristos    ordering control to resolve various hypothetical races without increasing
493a0698ed9Schristos    synchronization overhead.  (@davidtgoldblatt)
494a0698ed9Schristos  - Extensively optimize rtree via various methods:
495a0698ed9Schristos    + Add multiple layers of rtree lookup caching, since rtree lookups are now
496a0698ed9Schristos      part of fast-path deallocation.  (@interwq)
497a0698ed9Schristos    + Determine rtree layout at compile time.  (@jasone)
498a0698ed9Schristos    + Make the tree shallower for common configurations.  (@jasone)
499a0698ed9Schristos    + Embed the root node in the top-level rtree data structure, thus avoiding
500a0698ed9Schristos      one level of indirection.  (@jasone)
501a0698ed9Schristos    + Further specialize leaf elements as compared to internal node elements,
502a0698ed9Schristos      and directly embed extent metadata needed for fast-path deallocation.
503a0698ed9Schristos      (@jasone)
504a0698ed9Schristos    + Ignore leading always-zero address bits (architecture-specific).
505a0698ed9Schristos      (@jasone)
506a0698ed9Schristos  - Reorganize headers (ongoing work) to make them hermetic, and disentangle
507a0698ed9Schristos    various module dependencies.  (@davidtgoldblatt)
508a0698ed9Schristos  - Convert various internal data structures such as size class metadata from
509a0698ed9Schristos    boot-time-initialized to compile-time-initialized.  Propagate resulting data
510a0698ed9Schristos    structure simplifications, such as making arena metadata fixed-size.
511a0698ed9Schristos    (@jasone)
512a0698ed9Schristos  - Simplify size class lookups when constrained to size classes that are
513a0698ed9Schristos    multiples of the page size.  This speeds lookups, but the primary benefit is
514a0698ed9Schristos    complexity reduction in code that was the source of numerous regressions.
515a0698ed9Schristos    (@jasone)
516a0698ed9Schristos  - Lock individual extents when possible for localized extent operations,
517a0698ed9Schristos    rather than relying on a top-level arena lock.  (@davidtgoldblatt, @jasone)
518a0698ed9Schristos  - Use first fit layout policy instead of best fit, in order to improve
519a0698ed9Schristos    packing.  (@jasone)
520a0698ed9Schristos  - If munmap(2) is not in use, use an exponential series to grow each arena's
521a0698ed9Schristos    virtual memory, so that the number of disjoint virtual memory mappings
522a0698ed9Schristos    remains low.  (@jasone)
523a0698ed9Schristos  - Implement per arena base allocators, so that arenas never share any virtual
524a0698ed9Schristos    memory pages.  (@jasone)
525a0698ed9Schristos  - Automatically generate private symbol name mangling macros.  (@jasone)
526a0698ed9Schristos
527a0698ed9Schristos  Incompatible changes:
528a0698ed9Schristos  - Replace chunk hooks with an expanded/normalized set of extent hooks.
529a0698ed9Schristos    (@jasone)
530a0698ed9Schristos  - Remove ratio-based purging.  (@jasone)
531a0698ed9Schristos  - Remove --disable-tcache.  (@jasone)
532a0698ed9Schristos  - Remove --disable-tls.  (@jasone)
533a0698ed9Schristos  - Remove --enable-ivsalloc.  (@jasone)
534a0698ed9Schristos  - Remove --with-lg-size-class-group.  (@jasone)
535a0698ed9Schristos  - Remove --with-lg-tiny-min.  (@jasone)
536a0698ed9Schristos  - Remove --disable-cc-silence.  (@jasone)
537a0698ed9Schristos  - Remove --enable-code-coverage.  (@jasone)
538a0698ed9Schristos  - Remove --disable-munmap (replaced by opt.retain).  (@jasone)
539a0698ed9Schristos  - Remove Valgrind support.  (@jasone)
540a0698ed9Schristos  - Remove quarantine support.  (@jasone)
541a0698ed9Schristos  - Remove redzone support.  (@jasone)
542a0698ed9Schristos  - Remove mallctl interfaces (various authors):
543a0698ed9Schristos    + config.munmap
544a0698ed9Schristos    + config.tcache
545a0698ed9Schristos    + config.tls
546a0698ed9Schristos    + config.valgrind
547a0698ed9Schristos    + opt.lg_chunk
548a0698ed9Schristos    + opt.purge
549a0698ed9Schristos    + opt.lg_dirty_mult
550a0698ed9Schristos    + opt.decay_time
551a0698ed9Schristos    + opt.quarantine
552a0698ed9Schristos    + opt.redzone
553a0698ed9Schristos    + opt.thp
554a0698ed9Schristos    + arena.<i>.lg_dirty_mult
555a0698ed9Schristos    + arena.<i>.decay_time
556a0698ed9Schristos    + arena.<i>.chunk_hooks
557a0698ed9Schristos    + arenas.initialized
558a0698ed9Schristos    + arenas.lg_dirty_mult
559a0698ed9Schristos    + arenas.decay_time
560a0698ed9Schristos    + arenas.bin.<i>.run_size
561a0698ed9Schristos    + arenas.nlruns
562a0698ed9Schristos    + arenas.lrun.<i>.size
563a0698ed9Schristos    + arenas.nhchunks
564a0698ed9Schristos    + arenas.hchunk.<i>.size
565a0698ed9Schristos    + arenas.extend
566a0698ed9Schristos    + stats.cactive
567a0698ed9Schristos    + stats.arenas.<i>.lg_dirty_mult
568a0698ed9Schristos    + stats.arenas.<i>.decay_time
569a0698ed9Schristos    + stats.arenas.<i>.metadata.{mapped,allocated}
570a0698ed9Schristos    + stats.arenas.<i>.{npurge,nmadvise,purged}
571a0698ed9Schristos    + stats.arenas.<i>.huge.{allocated,nmalloc,ndalloc,nrequests}
572a0698ed9Schristos    + stats.arenas.<i>.bins.<j>.{nruns,reruns,curruns}
573a0698ed9Schristos    + stats.arenas.<i>.lruns.<j>.{nmalloc,ndalloc,nrequests,curruns}
574a0698ed9Schristos    + stats.arenas.<i>.hchunks.<j>.{nmalloc,ndalloc,nrequests,curhchunks}
575a0698ed9Schristos
576a0698ed9Schristos  Bug fixes:
577a0698ed9Schristos  - Improve interval-based profile dump triggering to dump only one profile when
578a0698ed9Schristos    a single allocation's size exceeds the interval.  (@jasone)
579a0698ed9Schristos  - Use prefixed function names (as controlled by --with-jemalloc-prefix) when
580a0698ed9Schristos    pruning backtrace frames in jeprof.  (@jasone)
581a0698ed9Schristos
582a0698ed9Schristos* 4.5.0 (February 28, 2017)
583a0698ed9Schristos
584a0698ed9Schristos  This is the first release to benefit from much broader continuous integration
585a0698ed9Schristos  testing, thanks to @davidtgoldblatt.  Had we had this testing infrastructure
586a0698ed9Schristos  in place for prior releases, it would have caught all of the most serious
587a0698ed9Schristos  regressions fixed by this release.
588a0698ed9Schristos
589a0698ed9Schristos  New features:
590a0698ed9Schristos  - Add --disable-thp and the opt.thp mallctl to provide opt-out mechanisms for
591a0698ed9Schristos    transparent huge page integration.  (@jasone)
592a0698ed9Schristos  - Update zone allocator integration to work with macOS 10.12.  (@glandium)
593a0698ed9Schristos  - Restructure *CFLAGS configuration, so that CFLAGS behaves typically, and
594a0698ed9Schristos    EXTRA_CFLAGS provides a way to specify e.g. -Werror during building, but not
595a0698ed9Schristos    during configuration.  (@jasone, @ronawho)
596a0698ed9Schristos
597a0698ed9Schristos  Bug fixes:
598a0698ed9Schristos  - Fix DSS (sbrk(2)-based) allocation.  This regression was first released in
599a0698ed9Schristos    4.3.0.  (@jasone)
600a0698ed9Schristos  - Handle race in per size class utilization computation.  This functionality
601a0698ed9Schristos    was first released in 4.0.0.  (@interwq)
602a0698ed9Schristos  - Fix lock order reversal during gdump.  (@jasone)
603a0698ed9Schristos  - Fix/refactor tcache synchronization.  This regression was first released in
604a0698ed9Schristos    4.0.0.  (@jasone)
605a0698ed9Schristos  - Fix various JSON-formatted malloc_stats_print() bugs.  This functionality
606a0698ed9Schristos    was first released in 4.3.0.  (@jasone)
607a0698ed9Schristos  - Fix huge-aligned allocation.  This regression was first released in 4.4.0.
608a0698ed9Schristos    (@jasone)
609a0698ed9Schristos  - When transparent huge page integration is enabled, detect what state pages
610a0698ed9Schristos    start in according to the kernel's current operating mode, and only convert
611a0698ed9Schristos    arena chunks to non-huge during purging if that is not their initial state.
612a0698ed9Schristos    This functionality was first released in 4.4.0.  (@jasone)
613a0698ed9Schristos  - Fix lg_chunk clamping for the --enable-cache-oblivious --disable-fill case.
614a0698ed9Schristos    This regression was first released in 4.0.0.  (@jasone, @428desmo)
615a0698ed9Schristos  - Properly detect sparc64 when building for Linux.  (@glaubitz)
616a0698ed9Schristos
617a0698ed9Schristos* 4.4.0 (December 3, 2016)
618a0698ed9Schristos
619a0698ed9Schristos  New features:
620a0698ed9Schristos  - Add configure support for *-*-linux-android.  (@cferris1000, @jasone)
621a0698ed9Schristos  - Add the --disable-syscall configure option, for use on systems that place
622a0698ed9Schristos    security-motivated limitations on syscall(2).  (@jasone)
623a0698ed9Schristos  - Add support for Debian GNU/kFreeBSD.  (@thesam)
624a0698ed9Schristos
625a0698ed9Schristos  Optimizations:
626a0698ed9Schristos  - Add extent serial numbers and use them where appropriate as a sort key that
627a0698ed9Schristos    is higher priority than address, so that the allocation policy prefers older
628a0698ed9Schristos    extents.  This tends to improve locality (decrease fragmentation) when
629a0698ed9Schristos    memory grows downward.  (@jasone)
630a0698ed9Schristos  - Refactor madvise(2) configuration so that MADV_FREE is detected and utilized
631a0698ed9Schristos    on Linux 4.5 and newer.  (@jasone)
632a0698ed9Schristos  - Mark partially purged arena chunks as non-huge-page.  This improves
633a0698ed9Schristos    interaction with Linux's transparent huge page functionality.  (@jasone)
634a0698ed9Schristos
635a0698ed9Schristos  Bug fixes:
636a0698ed9Schristos  - Fix size class computations for edge conditions involving extremely large
637a0698ed9Schristos    allocations.  This regression was first released in 4.0.0.  (@jasone,
638a0698ed9Schristos    @ingvarha)
639a0698ed9Schristos  - Remove overly restrictive assertions related to the cactive statistic.  This
640a0698ed9Schristos    regression was first released in 4.1.0.  (@jasone)
641a0698ed9Schristos  - Implement a more reliable detection scheme for os_unfair_lock on macOS.
642a0698ed9Schristos    (@jszakmeister)
643a0698ed9Schristos
644a0698ed9Schristos* 4.3.1 (November 7, 2016)
645a0698ed9Schristos
646a0698ed9Schristos  Bug fixes:
647a0698ed9Schristos  - Fix a severe virtual memory leak.  This regression was first released in
648a0698ed9Schristos    4.3.0.  (@interwq, @jasone)
649a0698ed9Schristos  - Refactor atomic and prng APIs to restore support for 32-bit platforms that
650a0698ed9Schristos    use pre-C11 toolchains, e.g. FreeBSD's mips.  (@jasone)
651a0698ed9Schristos
652a0698ed9Schristos* 4.3.0 (November 4, 2016)
653a0698ed9Schristos
654a0698ed9Schristos  This is the first release that passes the test suite for multiple Windows
655a0698ed9Schristos  configurations, thanks in large part to @glandium setting up continuous
656a0698ed9Schristos  integration via AppVeyor (and Travis CI for Linux and OS X).
657a0698ed9Schristos
658a0698ed9Schristos  New features:
659a0698ed9Schristos  - Add "J" (JSON) support to malloc_stats_print().  (@jasone)
660a0698ed9Schristos  - Add Cray compiler support.  (@ronawho)
661a0698ed9Schristos
662a0698ed9Schristos  Optimizations:
663a0698ed9Schristos  - Add/use adaptive spinning for bootstrapping and radix tree node
664a0698ed9Schristos    initialization.  (@jasone)
665a0698ed9Schristos
666a0698ed9Schristos  Bug fixes:
667a0698ed9Schristos  - Fix large allocation to search starting in the optimal size class heap,
668a0698ed9Schristos    which can substantially reduce virtual memory churn and fragmentation.  This
669a0698ed9Schristos    regression was first released in 4.0.0.  (@mjp41, @jasone)
670a0698ed9Schristos  - Fix stats.arenas.<i>.nthreads accounting.  (@interwq)
671a0698ed9Schristos  - Fix and simplify decay-based purging.  (@jasone)
672a0698ed9Schristos  - Make DSS (sbrk(2)-related) operations lockless, which resolves potential
673a0698ed9Schristos    deadlocks during thread exit.  (@jasone)
674a0698ed9Schristos  - Fix over-sized allocation of radix tree leaf nodes.  (@mjp41, @ogaun,
675a0698ed9Schristos    @jasone)
676a0698ed9Schristos  - Fix over-sized allocation of arena_t (plus associated stats) data
677a0698ed9Schristos    structures.  (@jasone, @interwq)
678a0698ed9Schristos  - Fix EXTRA_CFLAGS to not affect configuration.  (@jasone)
679a0698ed9Schristos  - Fix a Valgrind integration bug.  (@ronawho)
680a0698ed9Schristos  - Disallow 0x5a junk filling when running in Valgrind.  (@jasone)
681a0698ed9Schristos  - Fix a file descriptor leak on Linux.  This regression was first released in
682a0698ed9Schristos    4.2.0.  (@vsarunas, @jasone)
683a0698ed9Schristos  - Fix static linking of jemalloc with glibc.  (@djwatson)
684a0698ed9Schristos  - Use syscall(2) rather than {open,read,close}(2) during boot on Linux.  This
685a0698ed9Schristos    works around other libraries' system call wrappers performing reentrant
686a0698ed9Schristos    allocation.  (@kspinka, @Whissi, @jasone)
687a0698ed9Schristos  - Fix OS X default zone replacement to work with OS X 10.12.  (@glandium,
688a0698ed9Schristos    @jasone)
689a0698ed9Schristos  - Fix cached memory management to avoid needless commit/decommit operations
690a0698ed9Schristos    during purging, which resolves permanent virtual memory map fragmentation
691a0698ed9Schristos    issues on Windows.  (@mjp41, @jasone)
692a0698ed9Schristos  - Fix TSD fetches to avoid (recursive) allocation.  This is relevant to
693a0698ed9Schristos    non-TLS and Windows configurations.  (@jasone)
694a0698ed9Schristos  - Fix malloc_conf overriding to work on Windows.  (@jasone)
695a0698ed9Schristos  - Forcibly disable lazy-lock on Windows (was forcibly *enabled*).  (@jasone)
696a0698ed9Schristos
697a0698ed9Schristos* 4.2.1 (June 8, 2016)
698a0698ed9Schristos
699a0698ed9Schristos  Bug fixes:
700a0698ed9Schristos  - Fix bootstrapping issues for configurations that require allocation during
701a0698ed9Schristos    tsd initialization (e.g. --disable-tls).  (@cferris1000, @jasone)
702a0698ed9Schristos  - Fix gettimeofday() version of nstime_update().  (@ronawho)
703a0698ed9Schristos  - Fix Valgrind regressions in calloc() and chunk_alloc_wrapper().  (@ronawho)
704a0698ed9Schristos  - Fix potential VM map fragmentation regression.  (@jasone)
705a0698ed9Schristos  - Fix opt_zero-triggered in-place huge reallocation zeroing.  (@jasone)
706a0698ed9Schristos  - Fix heap profiling context leaks in reallocation edge cases.  (@jasone)
707a0698ed9Schristos
708a0698ed9Schristos* 4.2.0 (May 12, 2016)
709a0698ed9Schristos
710a0698ed9Schristos  New features:
711a0698ed9Schristos  - Add the arena.<i>.reset mallctl, which makes it possible to discard all of
712a0698ed9Schristos    an arena's allocations in a single operation.  (@jasone)
713a0698ed9Schristos  - Add the stats.retained and stats.arenas.<i>.retained statistics.  (@jasone)
714a0698ed9Schristos  - Add the --with-version configure option.  (@jasone)
715a0698ed9Schristos  - Support --with-lg-page values larger than actual page size.  (@jasone)
716a0698ed9Schristos
717a0698ed9Schristos  Optimizations:
718a0698ed9Schristos  - Use pairing heaps rather than red-black trees for various hot data
719a0698ed9Schristos    structures.  (@djwatson, @jasone)
720a0698ed9Schristos  - Streamline fast paths of rtree operations.  (@jasone)
721a0698ed9Schristos  - Optimize the fast paths of calloc() and [m,d,sd]allocx().  (@jasone)
722a0698ed9Schristos  - Decommit unused virtual memory if the OS does not overcommit.  (@jasone)
723a0698ed9Schristos  - Specify MAP_NORESERVE on Linux if [heuristic] overcommit is active, in order
724a0698ed9Schristos    to avoid unfortunate interactions during fork(2).  (@jasone)
725a0698ed9Schristos
726a0698ed9Schristos  Bug fixes:
727a0698ed9Schristos  - Fix chunk accounting related to triggering gdump profiles.  (@jasone)
728a0698ed9Schristos  - Link against librt for clock_gettime(2) if glibc < 2.17.  (@jasone)
729a0698ed9Schristos  - Scale leak report summary according to sampling probability.  (@jasone)
730a0698ed9Schristos
731a0698ed9Schristos* 4.1.1 (May 3, 2016)
732a0698ed9Schristos
733a0698ed9Schristos  This bugfix release resolves a variety of mostly minor issues, though the
734a0698ed9Schristos  bitmap fix is critical for 64-bit Windows.
735a0698ed9Schristos
736a0698ed9Schristos  Bug fixes:
737a0698ed9Schristos  - Fix the linear scan version of bitmap_sfu() to shift by the proper amount
738a0698ed9Schristos    even when sizeof(long) is not the same as sizeof(void *), as on 64-bit
739a0698ed9Schristos    Windows.  (@jasone)
740a0698ed9Schristos  - Fix hashing functions to avoid unaligned memory accesses (and resulting
741a0698ed9Schristos    crashes).  This is relevant at least to some ARM-based platforms.
742a0698ed9Schristos    (@rkmisra)
743a0698ed9Schristos  - Fix fork()-related lock rank ordering reversals.  These reversals were
744a0698ed9Schristos    unlikely to cause deadlocks in practice except when heap profiling was
745a0698ed9Schristos    enabled and active.  (@jasone)
746a0698ed9Schristos  - Fix various chunk leaks in OOM code paths.  (@jasone)
747a0698ed9Schristos  - Fix malloc_stats_print() to print opt.narenas correctly.  (@jasone)
748a0698ed9Schristos  - Fix MSVC-specific build/test issues.  (@rustyx, @yuslepukhin)
749a0698ed9Schristos  - Fix a variety of test failures that were due to test fragility rather than
750a0698ed9Schristos    core bugs.  (@jasone)
751a0698ed9Schristos
752a0698ed9Schristos* 4.1.0 (February 28, 2016)
753a0698ed9Schristos
754a0698ed9Schristos  This release is primarily about optimizations, but it also incorporates a lot
755a0698ed9Schristos  of portability-motivated refactoring and enhancements.  Many people worked on
756a0698ed9Schristos  this release, to an extent that even with the omission here of minor changes
757a0698ed9Schristos  (see git revision history), and of the people who reported and diagnosed
758a0698ed9Schristos  issues, so much of the work was contributed that starting with this release,
759a0698ed9Schristos  changes are annotated with author credits to help reflect the collaborative
760a0698ed9Schristos  effort involved.
761a0698ed9Schristos
762a0698ed9Schristos  New features:
763a0698ed9Schristos  - Implement decay-based unused dirty page purging, a major optimization with
764a0698ed9Schristos    mallctl API impact.  This is an alternative to the existing ratio-based
765a0698ed9Schristos    unused dirty page purging, and is intended to eventually become the sole
766a0698ed9Schristos    purging mechanism.  New mallctls:
767a0698ed9Schristos    + opt.purge
768a0698ed9Schristos    + opt.decay_time
769a0698ed9Schristos    + arena.<i>.decay
770a0698ed9Schristos    + arena.<i>.decay_time
771a0698ed9Schristos    + arenas.decay_time
772a0698ed9Schristos    + stats.arenas.<i>.decay_time
773a0698ed9Schristos    (@jasone, @cevans87)
774a0698ed9Schristos  - Add --with-malloc-conf, which makes it possible to embed a default
775a0698ed9Schristos    options string during configuration.  This was motivated by the desire to
776a0698ed9Schristos    specify --with-malloc-conf=purge:decay , since the default must remain
777a0698ed9Schristos    purge:ratio until the 5.0.0 release.  (@jasone)
778a0698ed9Schristos  - Add MS Visual Studio 2015 support.  (@rustyx, @yuslepukhin)
779a0698ed9Schristos  - Make *allocx() size class overflow behavior defined.  The maximum
780a0698ed9Schristos    size class is now less than PTRDIFF_MAX to protect applications against
781a0698ed9Schristos    numerical overflow, and all allocation functions are guaranteed to indicate
782a0698ed9Schristos    errors rather than potentially crashing if the request size exceeds the
783a0698ed9Schristos    maximum size class.  (@jasone)
784a0698ed9Schristos  - jeprof:
785a0698ed9Schristos    + Add raw heap profile support.  (@jasone)
786a0698ed9Schristos    + Add --retain and --exclude for backtrace symbol filtering.  (@jasone)
787a0698ed9Schristos
788a0698ed9Schristos  Optimizations:
789a0698ed9Schristos  - Optimize the fast path to combine various bootstrapping and configuration
790a0698ed9Schristos    checks and execute more streamlined code in the common case.  (@interwq)
791a0698ed9Schristos  - Use linear scan for small bitmaps (used for small object tracking).  In
792a0698ed9Schristos    addition to speeding up bitmap operations on 64-bit systems, this reduces
793a0698ed9Schristos    allocator metadata overhead by approximately 0.2%.  (@djwatson)
794a0698ed9Schristos  - Separate arena_avail trees, which substantially speeds up run tree
795a0698ed9Schristos    operations.  (@djwatson)
796a0698ed9Schristos  - Use memoization (boot-time-computed table) for run quantization.  Separate
797a0698ed9Schristos    arena_avail trees reduced the importance of this optimization.  (@jasone)
798a0698ed9Schristos  - Attempt mmap-based in-place huge reallocation.  This can dramatically speed
799a0698ed9Schristos    up incremental huge reallocation.  (@jasone)
800a0698ed9Schristos
801a0698ed9Schristos  Incompatible changes:
802a0698ed9Schristos  - Make opt.narenas unsigned rather than size_t.  (@jasone)
803a0698ed9Schristos
804a0698ed9Schristos  Bug fixes:
805a0698ed9Schristos  - Fix stats.cactive accounting regression.  (@rustyx, @jasone)
806a0698ed9Schristos  - Handle unaligned keys in hash().  This caused problems for some ARM systems.
807a0698ed9Schristos    (@jasone, @cferris1000)
808a0698ed9Schristos  - Refactor arenas array.  In addition to fixing a fork-related deadlock, this
809a0698ed9Schristos    makes arena lookups faster and simpler.  (@jasone)
810a0698ed9Schristos  - Move retained memory allocation out of the default chunk allocation
811a0698ed9Schristos    function, to a location that gets executed even if the application installs
812a0698ed9Schristos    a custom chunk allocation function.  This resolves a virtual memory leak.
813a0698ed9Schristos    (@buchgr)
814a0698ed9Schristos  - Fix a potential tsd cleanup leak.  (@cferris1000, @jasone)
815a0698ed9Schristos  - Fix run quantization.  In practice this bug had no impact unless
816a0698ed9Schristos    applications requested memory with alignment exceeding one page.
817a0698ed9Schristos    (@jasone, @djwatson)
818a0698ed9Schristos  - Fix LinuxThreads-specific bootstrapping deadlock.  (Cosmin Paraschiv)
819a0698ed9Schristos  - jeprof:
820a0698ed9Schristos    + Don't discard curl options if timeout is not defined.  (@djwatson)
821a0698ed9Schristos    + Detect failed profile fetches.  (@djwatson)
822a0698ed9Schristos  - Fix stats.arenas.<i>.{dss,lg_dirty_mult,decay_time,pactive,pdirty} for
823a0698ed9Schristos    --disable-stats case.  (@jasone)
824a0698ed9Schristos
825a0698ed9Schristos* 4.0.4 (October 24, 2015)
826a0698ed9Schristos
827a0698ed9Schristos  This bugfix release fixes another xallocx() regression.  No other regressions
828a0698ed9Schristos  have come to light in over a month, so this is likely a good starting point
829a0698ed9Schristos  for people who prefer to wait for "dot one" releases with all the major issues
830a0698ed9Schristos  shaken out.
831a0698ed9Schristos
832a0698ed9Schristos  Bug fixes:
833a0698ed9Schristos  - Fix xallocx(..., MALLOCX_ZERO to zero the last full trailing page of large
834a0698ed9Schristos    allocations that have been randomly assigned an offset of 0 when
835a0698ed9Schristos    --enable-cache-oblivious configure option is enabled.
836a0698ed9Schristos
837a0698ed9Schristos* 4.0.3 (September 24, 2015)
838a0698ed9Schristos
839a0698ed9Schristos  This bugfix release continues the trend of xallocx() and heap profiling fixes.
840a0698ed9Schristos
841a0698ed9Schristos  Bug fixes:
842a0698ed9Schristos  - Fix xallocx(..., MALLOCX_ZERO) to zero all trailing bytes of large
843a0698ed9Schristos    allocations when --enable-cache-oblivious configure option is enabled.
844a0698ed9Schristos  - Fix xallocx(..., MALLOCX_ZERO) to zero trailing bytes of huge allocations
845a0698ed9Schristos    when resizing from/to a size class that is not a multiple of the chunk size.
846a0698ed9Schristos  - Fix prof_tctx_dump_iter() to filter out nodes that were created after heap
847a0698ed9Schristos    profile dumping started.
848a0698ed9Schristos  - Work around a potentially bad thread-specific data initialization
849a0698ed9Schristos    interaction with NPTL (glibc's pthreads implementation).
850a0698ed9Schristos
851a0698ed9Schristos* 4.0.2 (September 21, 2015)
852a0698ed9Schristos
853a0698ed9Schristos  This bugfix release addresses a few bugs specific to heap profiling.
854a0698ed9Schristos
855a0698ed9Schristos  Bug fixes:
856a0698ed9Schristos  - Fix ixallocx_prof_sample() to never modify nor create sampled small
857a0698ed9Schristos    allocations.  xallocx() is in general incapable of moving small allocations,
858a0698ed9Schristos    so this fix removes buggy code without loss of generality.
859a0698ed9Schristos  - Fix irallocx_prof_sample() to always allocate large regions, even when
860a0698ed9Schristos    alignment is non-zero.
861a0698ed9Schristos  - Fix prof_alloc_rollback() to read tdata from thread-specific data rather
862a0698ed9Schristos    than dereferencing a potentially invalid tctx.
863a0698ed9Schristos
864a0698ed9Schristos* 4.0.1 (September 15, 2015)
865a0698ed9Schristos
866a0698ed9Schristos  This is a bugfix release that is somewhat high risk due to the amount of
867a0698ed9Schristos  refactoring required to address deep xallocx() problems.  As a side effect of
868a0698ed9Schristos  these fixes, xallocx() now tries harder to partially fulfill requests for
869a0698ed9Schristos  optional extra space.  Note that a couple of minor heap profiling
870a0698ed9Schristos  optimizations are included, but these are better thought of as performance
871a0698ed9Schristos  fixes that were integral to discovering most of the other bugs.
872a0698ed9Schristos
873a0698ed9Schristos  Optimizations:
874a0698ed9Schristos  - Avoid a chunk metadata read in arena_prof_tctx_set(), since it is in the
875a0698ed9Schristos    fast path when heap profiling is enabled.  Additionally, split a special
876a0698ed9Schristos    case out into arena_prof_tctx_reset(), which also avoids chunk metadata
877a0698ed9Schristos    reads.
878a0698ed9Schristos  - Optimize irallocx_prof() to optimistically update the sampler state.  The
879a0698ed9Schristos    prior implementation appears to have been a holdover from when
880a0698ed9Schristos    rallocx()/xallocx() functionality was combined as rallocm().
881a0698ed9Schristos
882a0698ed9Schristos  Bug fixes:
883a0698ed9Schristos  - Fix TLS configuration such that it is enabled by default for platforms on
884a0698ed9Schristos    which it works correctly.
885a0698ed9Schristos  - Fix arenas_cache_cleanup() and arena_get_hard() to handle
886a0698ed9Schristos    allocation/deallocation within the application's thread-specific data
887a0698ed9Schristos    cleanup functions even after arenas_cache is torn down.
888a0698ed9Schristos  - Fix xallocx() bugs related to size+extra exceeding HUGE_MAXCLASS.
889a0698ed9Schristos  - Fix chunk purge hook calls for in-place huge shrinking reallocation to
890a0698ed9Schristos    specify the old chunk size rather than the new chunk size.  This bug caused
891a0698ed9Schristos    no correctness issues for the default chunk purge function, but was
892a0698ed9Schristos    visible to custom functions set via the "arena.<i>.chunk_hooks" mallctl.
893a0698ed9Schristos  - Fix heap profiling bugs:
894a0698ed9Schristos    + Fix heap profiling to distinguish among otherwise identical sample sites
895a0698ed9Schristos      with interposed resets (triggered via the "prof.reset" mallctl).  This bug
896a0698ed9Schristos      could cause data structure corruption that would most likely result in a
897a0698ed9Schristos      segfault.
898a0698ed9Schristos    + Fix irealloc_prof() to prof_alloc_rollback() on OOM.
899a0698ed9Schristos    + Make one call to prof_active_get_unlocked() per allocation event, and use
900a0698ed9Schristos      the result throughout the relevant functions that handle an allocation
901a0698ed9Schristos      event.  Also add a missing check in prof_realloc().  These fixes protect
902a0698ed9Schristos      allocation events against concurrent prof_active changes.
903a0698ed9Schristos    + Fix ixallocx_prof() to pass usize_max and zero to ixallocx_prof_sample()
904a0698ed9Schristos      in the correct order.
905a0698ed9Schristos    + Fix prof_realloc() to call prof_free_sampled_object() after calling
906a0698ed9Schristos      prof_malloc_sample_object().  Prior to this fix, if tctx and old_tctx were
907a0698ed9Schristos      the same, the tctx could have been prematurely destroyed.
908a0698ed9Schristos  - Fix portability bugs:
909a0698ed9Schristos    + Don't bitshift by negative amounts when encoding/decoding run sizes in
910a0698ed9Schristos      chunk header maps.  This affected systems with page sizes greater than 8
911a0698ed9Schristos      KiB.
912a0698ed9Schristos    + Rename index_t to szind_t to avoid an existing type on Solaris.
913a0698ed9Schristos    + Add JEMALLOC_CXX_THROW to the memalign() function prototype, in order to
914a0698ed9Schristos      match glibc and avoid compilation errors when including both
915a0698ed9Schristos      jemalloc/jemalloc.h and malloc.h in C++ code.
916a0698ed9Schristos    + Don't assume that /bin/sh is appropriate when running size_classes.sh
917a0698ed9Schristos      during configuration.
918a0698ed9Schristos    + Consider __sparcv9 a synonym for __sparc64__ when defining LG_QUANTUM.
919a0698ed9Schristos    + Link tests to librt if it contains clock_gettime(2).
920a0698ed9Schristos
921a0698ed9Schristos* 4.0.0 (August 17, 2015)
922a0698ed9Schristos
923a0698ed9Schristos  This version contains many speed and space optimizations, both minor and
924a0698ed9Schristos  major.  The major themes are generalization, unification, and simplification.
925a0698ed9Schristos  Although many of these optimizations cause no visible behavior change, their
926a0698ed9Schristos  cumulative effect is substantial.
927a0698ed9Schristos
928a0698ed9Schristos  New features:
929a0698ed9Schristos  - Normalize size class spacing to be consistent across the complete size
930a0698ed9Schristos    range.  By default there are four size classes per size doubling, but this
931a0698ed9Schristos    is now configurable via the --with-lg-size-class-group option.  Also add the
932a0698ed9Schristos    --with-lg-page, --with-lg-page-sizes, --with-lg-quantum, and
933a0698ed9Schristos    --with-lg-tiny-min options, which can be used to tweak page and size class
934a0698ed9Schristos    settings.  Impacts:
935a0698ed9Schristos    + Worst case performance for incrementally growing/shrinking reallocation
936a0698ed9Schristos      is improved because there are far fewer size classes, and therefore
937a0698ed9Schristos      copying happens less often.
938a0698ed9Schristos    + Internal fragmentation is limited to 20% for all but the smallest size
939a0698ed9Schristos      classes (those less than four times the quantum).  (1B + 4 KiB)
940a0698ed9Schristos      and (1B + 4 MiB) previously suffered nearly 50% internal fragmentation.
941a0698ed9Schristos    + Chunk fragmentation tends to be lower because there are fewer distinct run
942a0698ed9Schristos      sizes to pack.
943a0698ed9Schristos  - Add support for explicit tcaches.  The "tcache.create", "tcache.flush", and
944a0698ed9Schristos    "tcache.destroy" mallctls control tcache lifetime and flushing, and the
945a0698ed9Schristos    MALLOCX_TCACHE(tc) and MALLOCX_TCACHE_NONE flags to the *allocx() API
946a0698ed9Schristos    control which tcache is used for each operation.
947a0698ed9Schristos  - Implement per thread heap profiling, as well as the ability to
948a0698ed9Schristos    enable/disable heap profiling on a per thread basis.  Add the "prof.reset",
949a0698ed9Schristos    "prof.lg_sample", "thread.prof.name", "thread.prof.active",
950a0698ed9Schristos    "opt.prof_thread_active_init", "prof.thread_active_init", and
951a0698ed9Schristos    "thread.prof.active" mallctls.
952a0698ed9Schristos  - Add support for per arena application-specified chunk allocators, configured
953a0698ed9Schristos    via the "arena.<i>.chunk_hooks" mallctl.
954a0698ed9Schristos  - Refactor huge allocation to be managed by arenas, so that arenas now
955a0698ed9Schristos    function as general purpose independent allocators.  This is important in
956a0698ed9Schristos    the context of user-specified chunk allocators, aside from the scalability
957a0698ed9Schristos    benefits.  Related new statistics:
958a0698ed9Schristos    + The "stats.arenas.<i>.huge.allocated", "stats.arenas.<i>.huge.nmalloc",
959a0698ed9Schristos      "stats.arenas.<i>.huge.ndalloc", and "stats.arenas.<i>.huge.nrequests"
960a0698ed9Schristos      mallctls provide high level per arena huge allocation statistics.
961a0698ed9Schristos    + The "arenas.nhchunks", "arenas.hchunk.<i>.size",
962a0698ed9Schristos      "stats.arenas.<i>.hchunks.<j>.nmalloc",
963a0698ed9Schristos      "stats.arenas.<i>.hchunks.<j>.ndalloc",
964a0698ed9Schristos      "stats.arenas.<i>.hchunks.<j>.nrequests", and
965a0698ed9Schristos      "stats.arenas.<i>.hchunks.<j>.curhchunks" mallctls provide per size class
966a0698ed9Schristos      statistics.
967a0698ed9Schristos  - Add the 'util' column to malloc_stats_print() output, which reports the
968a0698ed9Schristos    proportion of available regions that are currently in use for each small
969a0698ed9Schristos    size class.
970a0698ed9Schristos  - Add "alloc" and "free" modes for for junk filling (see the "opt.junk"
971a0698ed9Schristos    mallctl), so that it is possible to separately enable junk filling for
972a0698ed9Schristos    allocation versus deallocation.
973a0698ed9Schristos  - Add the jemalloc-config script, which provides information about how
974a0698ed9Schristos    jemalloc was configured, and how to integrate it into application builds.
975a0698ed9Schristos  - Add metadata statistics, which are accessible via the "stats.metadata",
976a0698ed9Schristos    "stats.arenas.<i>.metadata.mapped", and
977a0698ed9Schristos    "stats.arenas.<i>.metadata.allocated" mallctls.
978a0698ed9Schristos  - Add the "stats.resident" mallctl, which reports the upper limit of
979a0698ed9Schristos    physically resident memory mapped by the allocator.
980a0698ed9Schristos  - Add per arena control over unused dirty page purging, via the
981a0698ed9Schristos    "arenas.lg_dirty_mult", "arena.<i>.lg_dirty_mult", and
982a0698ed9Schristos    "stats.arenas.<i>.lg_dirty_mult" mallctls.
983a0698ed9Schristos  - Add the "prof.gdump" mallctl, which makes it possible to toggle the gdump
984a0698ed9Schristos    feature on/off during program execution.
985a0698ed9Schristos  - Add sdallocx(), which implements sized deallocation.  The primary
986a0698ed9Schristos    optimization over dallocx() is the removal of a metadata read, which often
987a0698ed9Schristos    suffers an L1 cache miss.
988a0698ed9Schristos  - Add missing header includes in jemalloc/jemalloc.h, so that applications
989a0698ed9Schristos    only have to #include <jemalloc/jemalloc.h>.
990a0698ed9Schristos  - Add support for additional platforms:
991a0698ed9Schristos    + Bitrig
992a0698ed9Schristos    + Cygwin
993a0698ed9Schristos    + DragonFlyBSD
994a0698ed9Schristos    + iOS
995a0698ed9Schristos    + OpenBSD
996a0698ed9Schristos    + OpenRISC/or1k
997a0698ed9Schristos
998a0698ed9Schristos  Optimizations:
999a0698ed9Schristos  - Maintain dirty runs in per arena LRUs rather than in per arena trees of
1000a0698ed9Schristos    dirty-run-containing chunks.  In practice this change significantly reduces
1001a0698ed9Schristos    dirty page purging volume.
1002a0698ed9Schristos  - Integrate whole chunks into the unused dirty page purging machinery.  This
1003a0698ed9Schristos    reduces the cost of repeated huge allocation/deallocation, because it
1004a0698ed9Schristos    effectively introduces a cache of chunks.
1005a0698ed9Schristos  - Split the arena chunk map into two separate arrays, in order to increase
1006a0698ed9Schristos    cache locality for the frequently accessed bits.
1007a0698ed9Schristos  - Move small run metadata out of runs, into arena chunk headers.  This reduces
1008a0698ed9Schristos    run fragmentation, smaller runs reduce external fragmentation for small size
1009a0698ed9Schristos    classes, and packed (less uniformly aligned) metadata layout improves CPU
1010a0698ed9Schristos    cache set distribution.
1011a0698ed9Schristos  - Randomly distribute large allocation base pointer alignment relative to page
1012a0698ed9Schristos    boundaries in order to more uniformly utilize CPU cache sets.  This can be
1013a0698ed9Schristos    disabled via the --disable-cache-oblivious configure option, and queried via
1014a0698ed9Schristos    the "config.cache_oblivious" mallctl.
1015a0698ed9Schristos  - Micro-optimize the fast paths for the public API functions.
1016a0698ed9Schristos  - Refactor thread-specific data to reside in a single structure.  This assures
1017a0698ed9Schristos    that only a single TLS read is necessary per call into the public API.
1018a0698ed9Schristos  - Implement in-place huge allocation growing and shrinking.
1019a0698ed9Schristos  - Refactor rtree (radix tree for chunk lookups) to be lock-free, and make
1020a0698ed9Schristos    additional optimizations that reduce maximum lookup depth to one or two
1021a0698ed9Schristos    levels.  This resolves what was a concurrency bottleneck for per arena huge
1022a0698ed9Schristos    allocation, because a global data structure is critical for determining
1023a0698ed9Schristos    which arenas own which huge allocations.
1024a0698ed9Schristos
1025a0698ed9Schristos  Incompatible changes:
1026a0698ed9Schristos  - Replace --enable-cc-silence with --disable-cc-silence to suppress spurious
1027a0698ed9Schristos    warnings by default.
1028a0698ed9Schristos  - Assure that the constness of malloc_usable_size()'s return type matches that
1029a0698ed9Schristos    of the system implementation.
1030a0698ed9Schristos  - Change the heap profile dump format to support per thread heap profiling,
1031a0698ed9Schristos    rename pprof to jeprof, and enhance it with the --thread=<n> option.  As a
1032a0698ed9Schristos    result, the bundled jeprof must now be used rather than the upstream
1033a0698ed9Schristos    (gperftools) pprof.
1034a0698ed9Schristos  - Disable "opt.prof_final" by default, in order to avoid atexit(3), which can
1035a0698ed9Schristos    internally deadlock on some platforms.
1036a0698ed9Schristos  - Change the "arenas.nlruns" mallctl type from size_t to unsigned.
1037a0698ed9Schristos  - Replace the "stats.arenas.<i>.bins.<j>.allocated" mallctl with
1038a0698ed9Schristos    "stats.arenas.<i>.bins.<j>.curregs".
1039a0698ed9Schristos  - Ignore MALLOC_CONF in set{uid,gid,cap} binaries.
1040a0698ed9Schristos  - Ignore MALLOCX_ARENA(a) in dallocx(), in favor of using the
1041a0698ed9Schristos    MALLOCX_TCACHE(tc) and MALLOCX_TCACHE_NONE flags to control tcache usage.
1042a0698ed9Schristos
1043a0698ed9Schristos  Removed features:
1044a0698ed9Schristos  - Remove the *allocm() API, which is superseded by the *allocx() API.
1045a0698ed9Schristos  - Remove the --enable-dss options, and make dss non-optional on all platforms
1046a0698ed9Schristos    which support sbrk(2).
1047a0698ed9Schristos  - Remove the "arenas.purge" mallctl, which was obsoleted by the
1048a0698ed9Schristos    "arena.<i>.purge" mallctl in 3.1.0.
1049a0698ed9Schristos  - Remove the unnecessary "opt.valgrind" mallctl; jemalloc automatically
1050a0698ed9Schristos    detects whether it is running inside Valgrind.
1051a0698ed9Schristos  - Remove the "stats.huge.allocated", "stats.huge.nmalloc", and
1052a0698ed9Schristos    "stats.huge.ndalloc" mallctls.
1053a0698ed9Schristos  - Remove the --enable-mremap option.
1054a0698ed9Schristos  - Remove the "stats.chunks.current", "stats.chunks.total", and
1055a0698ed9Schristos    "stats.chunks.high" mallctls.
1056a0698ed9Schristos
1057a0698ed9Schristos  Bug fixes:
1058a0698ed9Schristos  - Fix the cactive statistic to decrease (rather than increase) when active
1059a0698ed9Schristos    memory decreases.  This regression was first released in 3.5.0.
1060a0698ed9Schristos  - Fix OOM handling in memalign() and valloc().  A variant of this bug existed
1061a0698ed9Schristos    in all releases since 2.0.0, which introduced these functions.
1062a0698ed9Schristos  - Fix an OOM-related regression in arena_tcache_fill_small(), which could
1063a0698ed9Schristos    cause cache corruption on OOM.  This regression was present in all releases
1064a0698ed9Schristos    from 2.2.0 through 3.6.0.
1065a0698ed9Schristos  - Fix size class overflow handling for malloc(), posix_memalign(), memalign(),
1066a0698ed9Schristos    calloc(), and realloc() when profiling is enabled.
1067a0698ed9Schristos  - Fix the "arena.<i>.dss" mallctl to return an error if "primary" or
1068a0698ed9Schristos    "secondary" precedence is specified, but sbrk(2) is not supported.
1069a0698ed9Schristos  - Fix fallback lg_floor() implementations to handle extremely large inputs.
1070a0698ed9Schristos  - Ensure the default purgeable zone is after the default zone on OS X.
1071a0698ed9Schristos  - Fix latent bugs in atomic_*().
1072a0698ed9Schristos  - Fix the "arena.<i>.dss" mallctl to handle read-only calls.
1073a0698ed9Schristos  - Fix tls_model configuration to enable the initial-exec model when possible.
1074a0698ed9Schristos  - Mark malloc_conf as a weak symbol so that the application can override it.
1075a0698ed9Schristos  - Correctly detect glibc's adaptive pthread mutexes.
1076a0698ed9Schristos  - Fix the --without-export configure option.
1077a0698ed9Schristos
1078a0698ed9Schristos* 3.6.0 (March 31, 2014)
1079a0698ed9Schristos
1080a0698ed9Schristos  This version contains a critical bug fix for a regression present in 3.5.0 and
1081a0698ed9Schristos  3.5.1.
1082a0698ed9Schristos
1083a0698ed9Schristos  Bug fixes:
1084a0698ed9Schristos  - Fix a regression in arena_chunk_alloc() that caused crashes during
1085a0698ed9Schristos    small/large allocation if chunk allocation failed.  In the absence of this
1086a0698ed9Schristos    bug, chunk allocation failure would result in allocation failure, e.g.  NULL
1087a0698ed9Schristos    return from malloc().  This regression was introduced in 3.5.0.
1088a0698ed9Schristos  - Fix backtracing for gcc intrinsics-based backtracing by specifying
1089a0698ed9Schristos    -fno-omit-frame-pointer to gcc.  Note that the application (and all the
1090a0698ed9Schristos    libraries it links to) must also be compiled with this option for
1091a0698ed9Schristos    backtracing to be reliable.
1092a0698ed9Schristos  - Use dss allocation precedence for huge allocations as well as small/large
1093a0698ed9Schristos    allocations.
1094a0698ed9Schristos  - Fix test assertion failure message formatting.  This bug did not manifest on
1095a0698ed9Schristos    x86_64 systems because of implementation subtleties in va_list.
1096a0698ed9Schristos  - Fix inconsequential test failures for hash and SFMT code.
1097a0698ed9Schristos
1098a0698ed9Schristos  New features:
1099a0698ed9Schristos  - Support heap profiling on FreeBSD.  This feature depends on the proc
1100a0698ed9Schristos    filesystem being mounted during heap profile dumping.
1101a0698ed9Schristos
1102a0698ed9Schristos* 3.5.1 (February 25, 2014)
1103a0698ed9Schristos
1104a0698ed9Schristos  This version primarily addresses minor bugs in test code.
1105a0698ed9Schristos
1106a0698ed9Schristos  Bug fixes:
1107a0698ed9Schristos  - Configure Solaris/Illumos to use MADV_FREE.
1108a0698ed9Schristos  - Fix junk filling for mremap(2)-based huge reallocation.  This is only
1109a0698ed9Schristos    relevant if configuring with the --enable-mremap option specified.
1110a0698ed9Schristos  - Avoid compilation failure if 'restrict' C99 keyword is not supported by the
1111a0698ed9Schristos    compiler.
1112a0698ed9Schristos  - Add a configure test for SSE2 rather than assuming it is usable on i686
1113a0698ed9Schristos    systems.  This fixes test compilation errors, especially on 32-bit Linux
1114a0698ed9Schristos    systems.
1115a0698ed9Schristos  - Fix mallctl argument size mismatches (size_t vs. uint64_t) in the stats unit
1116a0698ed9Schristos    test.
1117a0698ed9Schristos  - Fix/remove flawed alignment-related overflow tests.
1118a0698ed9Schristos  - Prevent compiler optimizations that could change backtraces in the
1119a0698ed9Schristos    prof_accum unit test.
1120a0698ed9Schristos
1121a0698ed9Schristos* 3.5.0 (January 22, 2014)
1122a0698ed9Schristos
1123a0698ed9Schristos  This version focuses on refactoring and automated testing, though it also
1124a0698ed9Schristos  includes some non-trivial heap profiling optimizations not mentioned below.
1125a0698ed9Schristos
1126a0698ed9Schristos  New features:
1127a0698ed9Schristos  - Add the *allocx() API, which is a successor to the experimental *allocm()
1128a0698ed9Schristos    API.  The *allocx() functions are slightly simpler to use because they have
1129a0698ed9Schristos    fewer parameters, they directly return the results of primary interest, and
1130a0698ed9Schristos    mallocx()/rallocx() avoid the strict aliasing pitfall that
1131a0698ed9Schristos    allocm()/rallocm() share with posix_memalign().  Note that *allocm() is
1132a0698ed9Schristos    slated for removal in the next non-bugfix release.
1133a0698ed9Schristos  - Add support for LinuxThreads.
1134a0698ed9Schristos
1135a0698ed9Schristos  Bug fixes:
1136a0698ed9Schristos  - Unless heap profiling is enabled, disable floating point code and don't link
1137a0698ed9Schristos    with libm.  This, in combination with e.g. EXTRA_CFLAGS=-mno-sse on x64
1138a0698ed9Schristos    systems, makes it possible to completely disable floating point register
1139a0698ed9Schristos    use.  Some versions of glibc neglect to save/restore caller-saved floating
1140a0698ed9Schristos    point registers during dynamic lazy symbol loading, and the symbol loading
1141a0698ed9Schristos    code uses whatever malloc the application happens to have linked/loaded
1142a0698ed9Schristos    with, the result being potential floating point register corruption.
1143a0698ed9Schristos  - Report ENOMEM rather than EINVAL if an OOM occurs during heap profiling
1144a0698ed9Schristos    backtrace creation in imemalign().  This bug impacted posix_memalign() and
1145a0698ed9Schristos    aligned_alloc().
1146a0698ed9Schristos  - Fix a file descriptor leak in a prof_dump_maps() error path.
1147a0698ed9Schristos  - Fix prof_dump() to close the dump file descriptor for all relevant error
1148a0698ed9Schristos    paths.
1149a0698ed9Schristos  - Fix rallocm() to use the arena specified by the ALLOCM_ARENA(s) flag for
1150a0698ed9Schristos    allocation, not just deallocation.
1151a0698ed9Schristos  - Fix a data race for large allocation stats counters.
1152a0698ed9Schristos  - Fix a potential infinite loop during thread exit.  This bug occurred on
1153a0698ed9Schristos    Solaris, and could affect other platforms with similar pthreads TSD
1154a0698ed9Schristos    implementations.
1155a0698ed9Schristos  - Don't junk-fill reallocations unless usable size changes.  This fixes a
1156a0698ed9Schristos    violation of the *allocx()/*allocm() semantics.
1157a0698ed9Schristos  - Fix growing large reallocation to junk fill new space.
1158a0698ed9Schristos  - Fix huge deallocation to junk fill when munmap is disabled.
1159a0698ed9Schristos  - Change the default private namespace prefix from empty to je_, and change
1160a0698ed9Schristos    --with-private-namespace-prefix so that it prepends an additional prefix
1161a0698ed9Schristos    rather than replacing je_.  This reduces the likelihood of applications
1162a0698ed9Schristos    which statically link jemalloc experiencing symbol name collisions.
1163a0698ed9Schristos  - Add missing private namespace mangling (relevant when
1164a0698ed9Schristos    --with-private-namespace is specified).
1165a0698ed9Schristos  - Add and use JEMALLOC_INLINE_C so that static inline functions are marked as
1166a0698ed9Schristos    static even for debug builds.
1167a0698ed9Schristos  - Add a missing mutex unlock in a malloc_init_hard() error path.  In practice
1168a0698ed9Schristos    this error path is never executed.
1169a0698ed9Schristos  - Fix numerous bugs in malloc_strotumax() error handling/reporting.  These
1170a0698ed9Schristos    bugs had no impact except for malformed inputs.
1171a0698ed9Schristos  - Fix numerous bugs in malloc_snprintf().  These bugs were not exercised by
1172a0698ed9Schristos    existing calls, so they had no impact.
1173a0698ed9Schristos
1174a0698ed9Schristos* 3.4.1 (October 20, 2013)
1175a0698ed9Schristos
1176a0698ed9Schristos  Bug fixes:
1177a0698ed9Schristos  - Fix a race in the "arenas.extend" mallctl that could cause memory corruption
1178a0698ed9Schristos    of internal data structures and subsequent crashes.
1179a0698ed9Schristos  - Fix Valgrind integration flaws that caused Valgrind warnings about reads of
1180a0698ed9Schristos    uninitialized memory in:
1181a0698ed9Schristos    + arena chunk headers
1182a0698ed9Schristos    + internal zero-initialized data structures (relevant to tcache and prof
1183a0698ed9Schristos      code)
1184a0698ed9Schristos  - Preserve errno during the first allocation.  A readlink(2) call during
1185a0698ed9Schristos    initialization fails unless /etc/malloc.conf exists, so errno was typically
1186a0698ed9Schristos    set during the first allocation prior to this fix.
1187a0698ed9Schristos  - Fix compilation warnings reported by gcc 4.8.1.
1188a0698ed9Schristos
1189a0698ed9Schristos* 3.4.0 (June 2, 2013)
1190a0698ed9Schristos
1191a0698ed9Schristos  This version is essentially a small bugfix release, but the addition of
1192a0698ed9Schristos  aarch64 support requires that the minor version be incremented.
1193a0698ed9Schristos
1194a0698ed9Schristos  Bug fixes:
1195a0698ed9Schristos  - Fix race-triggered deadlocks in chunk_record().  These deadlocks were
1196a0698ed9Schristos    typically triggered by multiple threads concurrently deallocating huge
1197a0698ed9Schristos    objects.
1198a0698ed9Schristos
1199a0698ed9Schristos  New features:
1200a0698ed9Schristos  - Add support for the aarch64 architecture.
1201a0698ed9Schristos
1202a0698ed9Schristos* 3.3.1 (March 6, 2013)
1203a0698ed9Schristos
1204a0698ed9Schristos  This version fixes bugs that are typically encountered only when utilizing
1205a0698ed9Schristos  custom run-time options.
1206a0698ed9Schristos
1207a0698ed9Schristos  Bug fixes:
1208a0698ed9Schristos  - Fix a locking order bug that could cause deadlock during fork if heap
1209a0698ed9Schristos    profiling were enabled.
1210a0698ed9Schristos  - Fix a chunk recycling bug that could cause the allocator to lose track of
1211a0698ed9Schristos    whether a chunk was zeroed.  On FreeBSD, NetBSD, and OS X, it could cause
1212a0698ed9Schristos    corruption if allocating via sbrk(2) (unlikely unless running with the
1213a0698ed9Schristos    "dss:primary" option specified).  This was completely harmless on Linux
1214a0698ed9Schristos    unless using mlockall(2) (and unlikely even then, unless the
1215a0698ed9Schristos    --disable-munmap configure option or the "dss:primary" option was
1216a0698ed9Schristos    specified).  This regression was introduced in 3.1.0 by the
1217a0698ed9Schristos    mlockall(2)/madvise(2) interaction fix.
1218a0698ed9Schristos  - Fix TLS-related memory corruption that could occur during thread exit if the
1219a0698ed9Schristos    thread never allocated memory.  Only the quarantine and prof facilities were
1220a0698ed9Schristos    susceptible.
1221a0698ed9Schristos  - Fix two quarantine bugs:
1222a0698ed9Schristos    + Internal reallocation of the quarantined object array leaked the old
1223a0698ed9Schristos      array.
1224a0698ed9Schristos    + Reallocation failure for internal reallocation of the quarantined object
1225a0698ed9Schristos      array (very unlikely) resulted in memory corruption.
1226a0698ed9Schristos  - Fix Valgrind integration to annotate all internally allocated memory in a
1227a0698ed9Schristos    way that keeps Valgrind happy about internal data structure access.
1228a0698ed9Schristos  - Fix building for s390 systems.
1229a0698ed9Schristos
1230a0698ed9Schristos* 3.3.0 (January 23, 2013)
1231a0698ed9Schristos
1232a0698ed9Schristos  This version includes a few minor performance improvements in addition to the
1233a0698ed9Schristos  listed new features and bug fixes.
1234a0698ed9Schristos
1235a0698ed9Schristos  New features:
1236a0698ed9Schristos  - Add clipping support to lg_chunk option processing.
1237a0698ed9Schristos  - Add the --enable-ivsalloc option.
1238a0698ed9Schristos  - Add the --without-export option.
1239a0698ed9Schristos  - Add the --disable-zone-allocator option.
1240a0698ed9Schristos
1241a0698ed9Schristos  Bug fixes:
1242a0698ed9Schristos  - Fix "arenas.extend" mallctl to output the number of arenas.
1243a0698ed9Schristos  - Fix chunk_recycle() to unconditionally inform Valgrind that returned memory
1244a0698ed9Schristos    is undefined.
1245a0698ed9Schristos  - Fix build break on FreeBSD related to alloca.h.
1246a0698ed9Schristos
1247a0698ed9Schristos* 3.2.0 (November 9, 2012)
1248a0698ed9Schristos
1249a0698ed9Schristos  In addition to a couple of bug fixes, this version modifies page run
1250a0698ed9Schristos  allocation and dirty page purging algorithms in order to better control
1251a0698ed9Schristos  page-level virtual memory fragmentation.
1252a0698ed9Schristos
1253a0698ed9Schristos  Incompatible changes:
1254a0698ed9Schristos  - Change the "opt.lg_dirty_mult" default from 5 to 3 (32:1 to 8:1).
1255a0698ed9Schristos
1256a0698ed9Schristos  Bug fixes:
1257a0698ed9Schristos  - Fix dss/mmap allocation precedence code to use recyclable mmap memory only
1258a0698ed9Schristos    after primary dss allocation fails.
1259a0698ed9Schristos  - Fix deadlock in the "arenas.purge" mallctl.  This regression was introduced
1260a0698ed9Schristos    in 3.1.0 by the addition of the "arena.<i>.purge" mallctl.
1261a0698ed9Schristos
1262a0698ed9Schristos* 3.1.0 (October 16, 2012)
1263a0698ed9Schristos
1264a0698ed9Schristos  New features:
1265a0698ed9Schristos  - Auto-detect whether running inside Valgrind, thus removing the need to
1266a0698ed9Schristos    manually specify MALLOC_CONF=valgrind:true.
1267a0698ed9Schristos  - Add the "arenas.extend" mallctl, which allows applications to create
1268a0698ed9Schristos    manually managed arenas.
1269a0698ed9Schristos  - Add the ALLOCM_ARENA() flag for {,r,d}allocm().
1270a0698ed9Schristos  - Add the "opt.dss", "arena.<i>.dss", and "stats.arenas.<i>.dss" mallctls,
1271a0698ed9Schristos    which provide control over dss/mmap precedence.
1272a0698ed9Schristos  - Add the "arena.<i>.purge" mallctl, which obsoletes "arenas.purge".
1273a0698ed9Schristos  - Define LG_QUANTUM for hppa.
1274a0698ed9Schristos
1275a0698ed9Schristos  Incompatible changes:
1276a0698ed9Schristos  - Disable tcache by default if running inside Valgrind, in order to avoid
1277a0698ed9Schristos    making unallocated objects appear reachable to Valgrind.
1278a0698ed9Schristos  - Drop const from malloc_usable_size() argument on Linux.
1279a0698ed9Schristos
1280a0698ed9Schristos  Bug fixes:
1281a0698ed9Schristos  - Fix heap profiling crash if sampled object is freed via realloc(p, 0).
1282a0698ed9Schristos  - Remove const from __*_hook variable declarations, so that glibc can modify
1283a0698ed9Schristos    them during process forking.
1284a0698ed9Schristos  - Fix mlockall(2)/madvise(2) interaction.
1285a0698ed9Schristos  - Fix fork(2)-related deadlocks.
1286a0698ed9Schristos  - Fix error return value for "thread.tcache.enabled" mallctl.
1287a0698ed9Schristos
1288a0698ed9Schristos* 3.0.0 (May 11, 2012)
1289a0698ed9Schristos
1290a0698ed9Schristos  Although this version adds some major new features, the primary focus is on
1291a0698ed9Schristos  internal code cleanup that facilitates maintainability and portability, most
1292a0698ed9Schristos  of which is not reflected in the ChangeLog.  This is the first release to
1293a0698ed9Schristos  incorporate substantial contributions from numerous other developers, and the
1294a0698ed9Schristos  result is a more broadly useful allocator (see the git revision history for
1295a0698ed9Schristos  contribution details).  Note that the license has been unified, thanks to
1296a0698ed9Schristos  Facebook granting a license under the same terms as the other copyright
1297a0698ed9Schristos  holders (see COPYING).
1298a0698ed9Schristos
1299a0698ed9Schristos  New features:
1300a0698ed9Schristos  - Implement Valgrind support, redzones, and quarantine.
1301a0698ed9Schristos  - Add support for additional platforms:
1302a0698ed9Schristos    + FreeBSD
1303a0698ed9Schristos    + Mac OS X Lion
1304a0698ed9Schristos    + MinGW
1305a0698ed9Schristos    + Windows (no support yet for replacing the system malloc)
1306a0698ed9Schristos  - Add support for additional architectures:
1307a0698ed9Schristos    + MIPS
1308a0698ed9Schristos    + SH4
1309a0698ed9Schristos    + Tilera
1310a0698ed9Schristos  - Add support for cross compiling.
1311a0698ed9Schristos  - Add nallocm(), which rounds a request size up to the nearest size class
1312a0698ed9Schristos    without actually allocating.
1313a0698ed9Schristos  - Implement aligned_alloc() (blame C11).
1314a0698ed9Schristos  - Add the "thread.tcache.enabled" mallctl.
1315a0698ed9Schristos  - Add the "opt.prof_final" mallctl.
1316a0698ed9Schristos  - Update pprof (from gperftools 2.0).
1317a0698ed9Schristos  - Add the --with-mangling option.
1318a0698ed9Schristos  - Add the --disable-experimental option.
1319a0698ed9Schristos  - Add the --disable-munmap option, and make it the default on Linux.
1320a0698ed9Schristos  - Add the --enable-mremap option, which disables use of mremap(2) by default.
1321a0698ed9Schristos
1322a0698ed9Schristos  Incompatible changes:
1323a0698ed9Schristos  - Enable stats by default.
1324a0698ed9Schristos  - Enable fill by default.
1325a0698ed9Schristos  - Disable lazy locking by default.
1326a0698ed9Schristos  - Rename the "tcache.flush" mallctl to "thread.tcache.flush".
1327a0698ed9Schristos  - Rename the "arenas.pagesize" mallctl to "arenas.page".
1328a0698ed9Schristos  - Change the "opt.lg_prof_sample" default from 0 to 19 (1 B to 512 KiB).
1329a0698ed9Schristos  - Change the "opt.prof_accum" default from true to false.
1330a0698ed9Schristos
1331a0698ed9Schristos  Removed features:
1332a0698ed9Schristos  - Remove the swap feature, including the "config.swap", "swap.avail",
1333a0698ed9Schristos    "swap.prezeroed", "swap.nfds", and "swap.fds" mallctls.
1334a0698ed9Schristos  - Remove highruns statistics, including the
1335a0698ed9Schristos    "stats.arenas.<i>.bins.<j>.highruns" and
1336a0698ed9Schristos    "stats.arenas.<i>.lruns.<j>.highruns" mallctls.
1337a0698ed9Schristos  - As part of small size class refactoring, remove the "opt.lg_[qc]space_max",
1338a0698ed9Schristos    "arenas.cacheline", "arenas.subpage", "arenas.[tqcs]space_{min,max}", and
1339a0698ed9Schristos    "arenas.[tqcs]bins" mallctls.
1340a0698ed9Schristos  - Remove the "arenas.chunksize" mallctl.
1341a0698ed9Schristos  - Remove the "opt.lg_prof_tcmax" option.
1342a0698ed9Schristos  - Remove the "opt.lg_prof_bt_max" option.
1343a0698ed9Schristos  - Remove the "opt.lg_tcache_gc_sweep" option.
1344a0698ed9Schristos  - Remove the --disable-tiny option, including the "config.tiny" mallctl.
1345a0698ed9Schristos  - Remove the --enable-dynamic-page-shift configure option.
1346a0698ed9Schristos  - Remove the --enable-sysv configure option.
1347a0698ed9Schristos
1348a0698ed9Schristos  Bug fixes:
1349a0698ed9Schristos  - Fix a statistics-related bug in the "thread.arena" mallctl that could cause
1350a0698ed9Schristos    invalid statistics and crashes.
1351a0698ed9Schristos  - Work around TLS deallocation via free() on Linux.  This bug could cause
1352a0698ed9Schristos    write-after-free memory corruption.
1353a0698ed9Schristos  - Fix a potential deadlock that could occur during interval- and
1354a0698ed9Schristos    growth-triggered heap profile dumps.
1355a0698ed9Schristos  - Fix large calloc() zeroing bugs due to dropping chunk map unzeroed flags.
1356a0698ed9Schristos  - Fix chunk_alloc_dss() to stop claiming memory is zeroed.  This bug could
1357a0698ed9Schristos    cause memory corruption and crashes with --enable-dss specified.
1358a0698ed9Schristos  - Fix fork-related bugs that could cause deadlock in children between fork
1359a0698ed9Schristos    and exec.
1360a0698ed9Schristos  - Fix malloc_stats_print() to honor 'b' and 'l' in the opts parameter.
1361a0698ed9Schristos  - Fix realloc(p, 0) to act like free(p).
1362a0698ed9Schristos  - Do not enforce minimum alignment in memalign().
1363a0698ed9Schristos  - Check for NULL pointer in malloc_usable_size().
1364a0698ed9Schristos  - Fix an off-by-one heap profile statistics bug that could be observed in
1365a0698ed9Schristos    interval- and growth-triggered heap profiles.
1366a0698ed9Schristos  - Fix the "epoch" mallctl to update cached stats even if the passed in epoch
1367a0698ed9Schristos    is 0.
1368a0698ed9Schristos  - Fix bin->runcur management to fix a layout policy bug.  This bug did not
1369a0698ed9Schristos    affect correctness.
1370a0698ed9Schristos  - Fix a bug in choose_arena_hard() that potentially caused more arenas to be
1371a0698ed9Schristos    initialized than necessary.
1372a0698ed9Schristos  - Add missing "opt.lg_tcache_max" mallctl implementation.
1373a0698ed9Schristos  - Use glibc allocator hooks to make mixed allocator usage less likely.
1374a0698ed9Schristos  - Fix build issues for --disable-tcache.
1375a0698ed9Schristos  - Don't mangle pthread_create() when --with-private-namespace is specified.
1376a0698ed9Schristos
1377a0698ed9Schristos* 2.2.5 (November 14, 2011)
1378a0698ed9Schristos
1379a0698ed9Schristos  Bug fixes:
1380a0698ed9Schristos  - Fix huge_ralloc() race when using mremap(2).  This is a serious bug that
1381a0698ed9Schristos    could cause memory corruption and/or crashes.
1382a0698ed9Schristos  - Fix huge_ralloc() to maintain chunk statistics.
1383a0698ed9Schristos  - Fix malloc_stats_print(..., "a") output.
1384a0698ed9Schristos
1385a0698ed9Schristos* 2.2.4 (November 5, 2011)
1386a0698ed9Schristos
1387a0698ed9Schristos  Bug fixes:
1388a0698ed9Schristos  - Initialize arenas_tsd before using it.  This bug existed for 2.2.[0-3], as
1389a0698ed9Schristos    well as for --disable-tls builds in earlier releases.
1390a0698ed9Schristos  - Do not assume a 4 KiB page size in test/rallocm.c.
1391a0698ed9Schristos
1392a0698ed9Schristos* 2.2.3 (August 31, 2011)
1393a0698ed9Schristos
1394a0698ed9Schristos  This version fixes numerous bugs related to heap profiling.
1395a0698ed9Schristos
1396a0698ed9Schristos  Bug fixes:
1397a0698ed9Schristos  - Fix a prof-related race condition.  This bug could cause memory corruption,
1398a0698ed9Schristos    but only occurred in non-default configurations (prof_accum:false).
1399a0698ed9Schristos  - Fix off-by-one backtracing issues (make sure that prof_alloc_prep() is
1400a0698ed9Schristos    excluded from backtraces).
1401a0698ed9Schristos  - Fix a prof-related bug in realloc() (only triggered by OOM errors).
1402a0698ed9Schristos  - Fix prof-related bugs in allocm() and rallocm().
1403a0698ed9Schristos  - Fix prof_tdata_cleanup() for --disable-tls builds.
1404a0698ed9Schristos  - Fix a relative include path, to fix objdir builds.
1405a0698ed9Schristos
1406a0698ed9Schristos* 2.2.2 (July 30, 2011)
1407a0698ed9Schristos
1408a0698ed9Schristos  Bug fixes:
1409a0698ed9Schristos  - Fix a build error for --disable-tcache.
1410a0698ed9Schristos  - Fix assertions in arena_purge() (for real this time).
1411a0698ed9Schristos  - Add the --with-private-namespace option.  This is a workaround for symbol
1412a0698ed9Schristos    conflicts that can inadvertently arise when using static libraries.
1413a0698ed9Schristos
1414a0698ed9Schristos* 2.2.1 (March 30, 2011)
1415a0698ed9Schristos
1416a0698ed9Schristos  Bug fixes:
1417a0698ed9Schristos  - Implement atomic operations for x86/x64.  This fixes compilation failures
1418a0698ed9Schristos    for versions of gcc that are still in wide use.
1419a0698ed9Schristos  - Fix an assertion in arena_purge().
1420a0698ed9Schristos
1421a0698ed9Schristos* 2.2.0 (March 22, 2011)
1422a0698ed9Schristos
1423a0698ed9Schristos  This version incorporates several improvements to algorithms and data
1424a0698ed9Schristos  structures that tend to reduce fragmentation and increase speed.
1425a0698ed9Schristos
1426a0698ed9Schristos  New features:
1427a0698ed9Schristos  - Add the "stats.cactive" mallctl.
1428a0698ed9Schristos  - Update pprof (from google-perftools 1.7).
1429a0698ed9Schristos  - Improve backtracing-related configuration logic, and add the
1430a0698ed9Schristos    --disable-prof-libgcc option.
1431a0698ed9Schristos
1432a0698ed9Schristos  Bug fixes:
1433a0698ed9Schristos  - Change default symbol visibility from "internal", to "hidden", which
1434a0698ed9Schristos    decreases the overhead of library-internal function calls.
1435a0698ed9Schristos  - Fix symbol visibility so that it is also set on OS X.
1436a0698ed9Schristos  - Fix a build dependency regression caused by the introduction of the .pic.o
1437a0698ed9Schristos    suffix for PIC object files.
1438a0698ed9Schristos  - Add missing checks for mutex initialization failures.
1439a0698ed9Schristos  - Don't use libgcc-based backtracing except on x64, where it is known to work.
1440a0698ed9Schristos  - Fix deadlocks on OS X that were due to memory allocation in
1441a0698ed9Schristos    pthread_mutex_lock().
1442a0698ed9Schristos  - Heap profiling-specific fixes:
1443a0698ed9Schristos    + Fix memory corruption due to integer overflow in small region index
1444a0698ed9Schristos      computation, when using a small enough sample interval that profiling
1445a0698ed9Schristos      context pointers are stored in small run headers.
1446a0698ed9Schristos    + Fix a bootstrap ordering bug that only occurred with TLS disabled.
1447a0698ed9Schristos    + Fix a rallocm() rsize bug.
1448a0698ed9Schristos    + Fix error detection bugs for aligned memory allocation.
1449a0698ed9Schristos
1450a0698ed9Schristos* 2.1.3 (March 14, 2011)
1451a0698ed9Schristos
1452a0698ed9Schristos  Bug fixes:
1453a0698ed9Schristos  - Fix a cpp logic regression (due to the "thread.{de,}allocatedp" mallctl fix
1454a0698ed9Schristos    for OS X in 2.1.2).
1455a0698ed9Schristos  - Fix a "thread.arena" mallctl bug.
1456a0698ed9Schristos  - Fix a thread cache stats merging bug.
1457a0698ed9Schristos
1458a0698ed9Schristos* 2.1.2 (March 2, 2011)
1459a0698ed9Schristos
1460a0698ed9Schristos  Bug fixes:
1461a0698ed9Schristos  - Fix "thread.{de,}allocatedp" mallctl for OS X.
1462a0698ed9Schristos  - Add missing jemalloc.a to build system.
1463a0698ed9Schristos
1464a0698ed9Schristos* 2.1.1 (January 31, 2011)
1465a0698ed9Schristos
1466a0698ed9Schristos  Bug fixes:
1467a0698ed9Schristos  - Fix aligned huge reallocation (affected allocm()).
1468a0698ed9Schristos  - Fix the ALLOCM_LG_ALIGN macro definition.
1469a0698ed9Schristos  - Fix a heap dumping deadlock.
1470a0698ed9Schristos  - Fix a "thread.arena" mallctl bug.
1471a0698ed9Schristos
1472a0698ed9Schristos* 2.1.0 (December 3, 2010)
1473a0698ed9Schristos
1474a0698ed9Schristos  This version incorporates some optimizations that can't quite be considered
1475a0698ed9Schristos  bug fixes.
1476a0698ed9Schristos
1477a0698ed9Schristos  New features:
1478a0698ed9Schristos  - Use Linux's mremap(2) for huge object reallocation when possible.
1479a0698ed9Schristos  - Avoid locking in mallctl*() when possible.
1480a0698ed9Schristos  - Add the "thread.[de]allocatedp" mallctl's.
1481a0698ed9Schristos  - Convert the manual page source from roff to DocBook, and generate both roff
1482a0698ed9Schristos    and HTML manuals.
1483a0698ed9Schristos
1484a0698ed9Schristos  Bug fixes:
1485a0698ed9Schristos  - Fix a crash due to incorrect bootstrap ordering.  This only impacted
1486a0698ed9Schristos    --enable-debug --enable-dss configurations.
1487a0698ed9Schristos  - Fix a minor statistics bug for mallctl("swap.avail", ...).
1488a0698ed9Schristos
1489a0698ed9Schristos* 2.0.1 (October 29, 2010)
1490a0698ed9Schristos
1491a0698ed9Schristos  Bug fixes:
1492a0698ed9Schristos  - Fix a race condition in heap profiling that could cause undefined behavior
1493a0698ed9Schristos    if "opt.prof_accum" were disabled.
1494a0698ed9Schristos  - Add missing mutex unlocks for some OOM error paths in the heap profiling
1495a0698ed9Schristos    code.
1496a0698ed9Schristos  - Fix a compilation error for non-C99 builds.
1497a0698ed9Schristos
1498a0698ed9Schristos* 2.0.0 (October 24, 2010)
1499a0698ed9Schristos
1500a0698ed9Schristos  This version focuses on the experimental *allocm() API, and on improved
1501a0698ed9Schristos  run-time configuration/introspection.  Nonetheless, numerous performance
1502a0698ed9Schristos  improvements are also included.
1503a0698ed9Schristos
1504a0698ed9Schristos  New features:
1505a0698ed9Schristos  - Implement the experimental {,r,s,d}allocm() API, which provides a superset
1506a0698ed9Schristos    of the functionality available via malloc(), calloc(), posix_memalign(),
1507a0698ed9Schristos    realloc(), malloc_usable_size(), and free().  These functions can be used to
1508a0698ed9Schristos    allocate/reallocate aligned zeroed memory, ask for optional extra memory
1509a0698ed9Schristos    during reallocation, prevent object movement during reallocation, etc.
1510a0698ed9Schristos  - Replace JEMALLOC_OPTIONS/JEMALLOC_PROF_PREFIX with MALLOC_CONF, which is
1511a0698ed9Schristos    more human-readable, and more flexible.  For example:
1512a0698ed9Schristos      JEMALLOC_OPTIONS=AJP
1513a0698ed9Schristos    is now:
1514a0698ed9Schristos      MALLOC_CONF=abort:true,fill:true,stats_print:true
1515a0698ed9Schristos  - Port to Apple OS X.  Sponsored by Mozilla.
1516a0698ed9Schristos  - Make it possible for the application to control thread-->arena mappings via
1517a0698ed9Schristos    the "thread.arena" mallctl.
1518a0698ed9Schristos  - Add compile-time support for all TLS-related functionality via pthreads TSD.
1519a0698ed9Schristos    This is mainly of interest for OS X, which does not support TLS, but has a
1520a0698ed9Schristos    TSD implementation with similar performance.
1521a0698ed9Schristos  - Override memalign() and valloc() if they are provided by the system.
1522a0698ed9Schristos  - Add the "arenas.purge" mallctl, which can be used to synchronously purge all
1523a0698ed9Schristos    dirty unused pages.
1524a0698ed9Schristos  - Make cumulative heap profiling data optional, so that it is possible to
1525a0698ed9Schristos    limit the amount of memory consumed by heap profiling data structures.
1526a0698ed9Schristos  - Add per thread allocation counters that can be accessed via the
1527a0698ed9Schristos    "thread.allocated" and "thread.deallocated" mallctls.
1528a0698ed9Schristos
1529a0698ed9Schristos  Incompatible changes:
1530a0698ed9Schristos  - Remove JEMALLOC_OPTIONS and malloc_options (see MALLOC_CONF above).
1531a0698ed9Schristos  - Increase default backtrace depth from 4 to 128 for heap profiling.
1532a0698ed9Schristos  - Disable interval-based profile dumps by default.
1533a0698ed9Schristos
1534a0698ed9Schristos  Bug fixes:
1535a0698ed9Schristos  - Remove bad assertions in fork handler functions.  These assertions could
1536a0698ed9Schristos    cause aborts for some combinations of configure settings.
1537a0698ed9Schristos  - Fix strerror_r() usage to deal with non-standard semantics in GNU libc.
1538a0698ed9Schristos  - Fix leak context reporting.  This bug tended to cause the number of contexts
1539a0698ed9Schristos    to be underreported (though the reported number of objects and bytes were
1540a0698ed9Schristos    correct).
1541a0698ed9Schristos  - Fix a realloc() bug for large in-place growing reallocation.  This bug could
1542a0698ed9Schristos    cause memory corruption, but it was hard to trigger.
1543a0698ed9Schristos  - Fix an allocation bug for small allocations that could be triggered if
1544a0698ed9Schristos    multiple threads raced to create a new run of backing pages.
1545a0698ed9Schristos  - Enhance the heap profiler to trigger samples based on usable size, rather
1546a0698ed9Schristos    than request size.
1547a0698ed9Schristos  - Fix a heap profiling bug due to sometimes losing track of requested object
1548a0698ed9Schristos    size for sampled objects.
1549a0698ed9Schristos
1550a0698ed9Schristos* 1.0.3 (August 12, 2010)
1551a0698ed9Schristos
1552a0698ed9Schristos  Bug fixes:
1553a0698ed9Schristos  - Fix the libunwind-based implementation of stack backtracing (used for heap
1554a0698ed9Schristos    profiling).  This bug could cause zero-length backtraces to be reported.
1555a0698ed9Schristos  - Add a missing mutex unlock in library initialization code.  If multiple
1556a0698ed9Schristos    threads raced to initialize malloc, some of them could end up permanently
1557a0698ed9Schristos    blocked.
1558a0698ed9Schristos
1559a0698ed9Schristos* 1.0.2 (May 11, 2010)
1560a0698ed9Schristos
1561a0698ed9Schristos  Bug fixes:
1562a0698ed9Schristos  - Fix junk filling of large objects, which could cause memory corruption.
1563a0698ed9Schristos  - Add MAP_NORESERVE support for chunk mapping, because otherwise virtual
1564a0698ed9Schristos    memory limits could cause swap file configuration to fail.  Contributed by
1565a0698ed9Schristos    Jordan DeLong.
1566a0698ed9Schristos
1567a0698ed9Schristos* 1.0.1 (April 14, 2010)
1568a0698ed9Schristos
1569a0698ed9Schristos  Bug fixes:
1570a0698ed9Schristos  - Fix compilation when --enable-fill is specified.
1571a0698ed9Schristos  - Fix threads-related profiling bugs that affected accuracy and caused memory
1572a0698ed9Schristos    to be leaked during thread exit.
1573a0698ed9Schristos  - Fix dirty page purging race conditions that could cause crashes.
1574a0698ed9Schristos  - Fix crash in tcache flushing code during thread destruction.
1575a0698ed9Schristos
1576a0698ed9Schristos* 1.0.0 (April 11, 2010)
1577a0698ed9Schristos
1578a0698ed9Schristos  This release focuses on speed and run-time introspection.  Numerous
1579a0698ed9Schristos  algorithmic improvements make this release substantially faster than its
1580a0698ed9Schristos  predecessors.
1581a0698ed9Schristos
1582a0698ed9Schristos  New features:
1583a0698ed9Schristos  - Implement autoconf-based configuration system.
1584a0698ed9Schristos  - Add mallctl*(), for the purposes of introspection and run-time
1585a0698ed9Schristos    configuration.
1586a0698ed9Schristos  - Make it possible for the application to manually flush a thread's cache, via
1587a0698ed9Schristos    the "tcache.flush" mallctl.
1588a0698ed9Schristos  - Base maximum dirty page count on proportion of active memory.
1589a0698ed9Schristos  - Compute various additional run-time statistics, including per size class
1590a0698ed9Schristos    statistics for large objects.
1591a0698ed9Schristos  - Expose malloc_stats_print(), which can be called repeatedly by the
1592a0698ed9Schristos    application.
1593a0698ed9Schristos  - Simplify the malloc_message() signature to only take one string argument,
1594a0698ed9Schristos    and incorporate an opaque data pointer argument for use by the application
1595a0698ed9Schristos    in combination with malloc_stats_print().
1596a0698ed9Schristos  - Add support for allocation backed by one or more swap files, and allow the
1597a0698ed9Schristos    application to disable over-commit if swap files are in use.
1598a0698ed9Schristos  - Implement allocation profiling and leak checking.
1599a0698ed9Schristos
1600a0698ed9Schristos  Removed features:
1601a0698ed9Schristos  - Remove the dynamic arena rebalancing code, since thread-specific caching
1602a0698ed9Schristos    reduces its utility.
1603a0698ed9Schristos
1604a0698ed9Schristos  Bug fixes:
1605a0698ed9Schristos  - Modify chunk allocation to work when address space layout randomization
1606a0698ed9Schristos    (ASLR) is in use.
1607a0698ed9Schristos  - Fix thread cleanup bugs related to TLS destruction.
1608a0698ed9Schristos  - Handle 0-size allocation requests in posix_memalign().
1609a0698ed9Schristos  - Fix a chunk leak.  The leaked chunks were never touched, so this impacted
1610a0698ed9Schristos    virtual memory usage, but not physical memory usage.
1611a0698ed9Schristos
1612a0698ed9Schristos* linux_2008082[78]a (August 27/28, 2008)
1613a0698ed9Schristos
1614a0698ed9Schristos  These snapshot releases are the simple result of incorporating Linux-specific
1615a0698ed9Schristos  support into the FreeBSD malloc sources.
1616a0698ed9Schristos
1617a0698ed9Schristos--------------------------------------------------------------------------------
1618a0698ed9Schristosvim:filetype=text:textwidth=80
1619