Skip to content

Commit ea6b3e9

Browse files
committed
Merge branch 'dev'
2 parents b0b3e49 + 0cfa36a commit ea6b3e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1829
-373
lines changed

.appveyor.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@ environment:
55
- MSYSTEM: MINGW64
66
CPU: x86_64
77
MSVC: amd64
8+
CONFIG_FLAGS: --enable-debug
9+
- MSYSTEM: MINGW64
10+
CPU: x86_64
11+
CONFIG_FLAGS: --enable-debug
812
- MSYSTEM: MINGW32
913
CPU: i686
1014
MSVC: x86
11-
- MSYSTEM: MINGW64
12-
CPU: x86_64
15+
CONFIG_FLAGS: --enable-debug
1316
- MSYSTEM: MINGW32
1417
CPU: i686
18+
CONFIG_FLAGS: --enable-debug
1519
- MSYSTEM: MINGW64
1620
CPU: x86_64
1721
MSVC: amd64
18-
CONFIG_FLAGS: --enable-debug
22+
- MSYSTEM: MINGW64
23+
CPU: x86_64
1924
- MSYSTEM: MINGW32
2025
CPU: i686
2126
MSVC: x86
22-
CONFIG_FLAGS: --enable-debug
23-
- MSYSTEM: MINGW64
24-
CPU: x86_64
25-
CONFIG_FLAGS: --enable-debug
2627
- MSYSTEM: MINGW32
2728
CPU: i686
28-
CONFIG_FLAGS: --enable-debug
2929

3030
install:
3131
- set PATH=c:\msys64\%MSYSTEM%\bin;c:\msys64\usr\bin;%PATH%

.travis.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ matrix:
2323
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-stats" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
2424
- os: linux
2525
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-libdl" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
26+
- os: linux
27+
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-opt-safety-checks" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
2628
- os: linux
2729
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--with-malloc-conf=tcache:false" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
2830
- os: linux
@@ -41,6 +43,8 @@ matrix:
4143
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-stats" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
4244
- os: osx
4345
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-libdl" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
46+
- os: osx
47+
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-opt-safety-checks" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
4448
- os: osx
4549
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--with-malloc-conf=tcache:false" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
4650
- os: linux
@@ -54,6 +58,8 @@ matrix:
5458
env: CC=clang CXX=clang++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-stats" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
5559
- os: linux
5660
env: CC=clang CXX=clang++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-libdl" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
61+
- os: linux
62+
env: CC=clang CXX=clang++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-opt-safety-checks" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
5763
- os: linux
5864
env: CC=clang CXX=clang++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--with-malloc-conf=tcache:false" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
5965
- os: linux
@@ -74,6 +80,9 @@ matrix:
7480
- os: linux
7581
env: CC=gcc CXX=g++ COMPILER_FLAGS="-m32" CONFIGURE_FLAGS="--disable-libdl" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
7682
addons: *gcc_multilib
83+
- os: linux
84+
env: CC=gcc CXX=g++ COMPILER_FLAGS="-m32" CONFIGURE_FLAGS="--enable-opt-safety-checks" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
85+
addons: *gcc_multilib
7786
- os: linux
7887
env: CC=gcc CXX=g++ COMPILER_FLAGS="-m32" CONFIGURE_FLAGS="--with-malloc-conf=tcache:false" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
7988
addons: *gcc_multilib
@@ -92,6 +101,8 @@ matrix:
92101
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-debug --disable-stats" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
93102
- os: linux
94103
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-debug --disable-libdl" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
104+
- os: linux
105+
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-debug --enable-opt-safety-checks" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
95106
- os: linux
96107
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-debug --with-malloc-conf=tcache:false" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
97108
- os: linux
@@ -104,6 +115,8 @@ matrix:
104115
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-prof --disable-stats" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
105116
- os: linux
106117
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-prof --disable-libdl" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
118+
- os: linux
119+
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-prof --enable-opt-safety-checks" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
107120
- os: linux
108121
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-prof --with-malloc-conf=tcache:false" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
109122
- os: linux
@@ -114,6 +127,8 @@ matrix:
114127
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-prof --with-malloc-conf=background_thread:true" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
115128
- os: linux
116129
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-stats --disable-libdl" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
130+
- os: linux
131+
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-stats --enable-opt-safety-checks" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
117132
- os: linux
118133
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-stats --with-malloc-conf=tcache:false" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
119134
- os: linux
@@ -122,6 +137,8 @@ matrix:
122137
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-stats --with-malloc-conf=percpu_arena:percpu" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
123138
- os: linux
124139
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-stats --with-malloc-conf=background_thread:true" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
140+
- os: linux
141+
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-libdl --enable-opt-safety-checks" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
125142
- os: linux
126143
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-libdl --with-malloc-conf=tcache:false" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
127144
- os: linux
@@ -130,6 +147,14 @@ matrix:
130147
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-libdl --with-malloc-conf=percpu_arena:percpu" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
131148
- os: linux
132149
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--disable-libdl --with-malloc-conf=background_thread:true" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
150+
- os: linux
151+
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-opt-safety-checks --with-malloc-conf=tcache:false" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
152+
- os: linux
153+
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-opt-safety-checks --with-malloc-conf=dss:primary" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
154+
- os: linux
155+
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-opt-safety-checks --with-malloc-conf=percpu_arena:percpu" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
156+
- os: linux
157+
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--enable-opt-safety-checks --with-malloc-conf=background_thread:true" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
133158
- os: linux
134159
env: CC=gcc CXX=g++ COMPILER_FLAGS="" CONFIGURE_FLAGS="--with-malloc-conf=tcache:false,dss:primary" EXTRA_CFLAGS="-Werror -Wno-array-bounds"
135160
- os: linux

ChangeLog

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,39 @@ brevity. Much more detail can be found in the git revision history:
44

55
https://github.com/jemalloc/jemalloc
66

7+
* 5.2.1 (August 5, 2019)
8+
9+
This release is primarily about Windows. A critical virtual memory leak is
10+
resolved on all Windows platforms. The regression was present in all releases
11+
since 5.0.0.
12+
13+
Bug fixes:
14+
- Fix a severe virtual memory leak on Windows. This regression was first
15+
released in 5.0.0. (@Ignition, @j0t, @frederik-h, @davidtgoldblatt,
16+
@interwq)
17+
- Fix size 0 handling in posix_memalign(). This regression was first released
18+
in 5.2.0. (@interwq)
19+
- Fix the prof_log unit test which may observe unexpected backtraces from
20+
compiler optimizations. The test was first added in 5.2.0. (@marxin,
21+
@gnzlbg, @interwq)
22+
- Fix the declaration of the extent_avail tree. This regression was first
23+
released in 5.1.0. (@zoulasc)
24+
- Fix an incorrect reference in jeprof. This functionality was first released
25+
in 3.0.0. (@prehistoric-penguin)
26+
- Fix an assertion on the deallocation fast-path. This regression was first
27+
released in 5.2.0. (@yinan1048576)
28+
- Fix the TLS_MODEL attribute in headers. This regression was first released
29+
in 5.0.0. (@zoulasc, @interwq)
30+
31+
Optimizations and refactors:
32+
- Implement opt.retain on Windows and enable by default on 64-bit. (@interwq,
33+
@davidtgoldblatt)
34+
- Optimize away a branch on the operator delete[] path. (@mgrice)
35+
- Add format annotation to the format generator function. (@zoulasc)
36+
- Refactor and improve the size class header generation. (@yinan1048576)
37+
- Remove best fit. (@djwatson)
38+
- Avoid blocking on background thread locks for stats. (@oranagra, @interwq)
39+
740
* 5.2.0 (April 2, 2019)
841

942
This release includes a few notable improvements, which are summarized below:

Makefile.in

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ cfghdrs_out := @cfghdrs_out@
5656
cfgoutputs_in := $(addprefix $(srcroot),@cfgoutputs_in@)
5757
cfgoutputs_out := @cfgoutputs_out@
5858
enable_autogen := @enable_autogen@
59+
enable_doc := @enable_doc@
5960
enable_shared := @enable_shared@
6061
enable_static := @enable_static@
6162
enable_prof := @enable_prof@
@@ -117,6 +118,7 @@ C_SRCS := $(srcroot)src/jemalloc.c \
117118
$(srcroot)src/prng.c \
118119
$(srcroot)src/prof.c \
119120
$(srcroot)src/rtree.c \
121+
$(srcroot)src/safety_check.c \
120122
$(srcroot)src/stats.c \
121123
$(srcroot)src/sc.c \
122124
$(srcroot)src/sz.c \
@@ -178,6 +180,7 @@ TESTS_UNIT := \
178180
$(srcroot)test/unit/div.c \
179181
$(srcroot)test/unit/emitter.c \
180182
$(srcroot)test/unit/extent_quantize.c \
183+
$(srcroot)test/unit/extent_util.c \
181184
$(srcroot)test/unit/fork.c \
182185
$(srcroot)test/unit/hash.c \
183186
$(srcroot)test/unit/hook.c \
@@ -208,6 +211,7 @@ TESTS_UNIT := \
208211
$(srcroot)test/unit/rb.c \
209212
$(srcroot)test/unit/retained.c \
210213
$(srcroot)test/unit/rtree.c \
214+
$(srcroot)test/unit/safety_check.c \
211215
$(srcroot)test/unit/seq.c \
212216
$(srcroot)test/unit/SFMT.c \
213217
$(srcroot)test/unit/sc.c \
@@ -513,7 +517,11 @@ done
513517

514518
install_doc: build_doc install_doc_html install_doc_man
515519

516-
install: install_bin install_include install_lib install_doc
520+
install: install_bin install_include install_lib
521+
522+
ifeq ($(enable_doc), 1)
523+
install: install_doc
524+
endif
517525

518526
tests_unit: $(TESTS_UNIT:$(srcroot)%.c=$(objroot)%$(EXE))
519527
tests_integration: $(TESTS_INTEGRATION:$(srcroot)%.c=$(objroot)%$(EXE)) $(TESTS_INTEGRATION_CPP:$(srcroot)%.cpp=$(objroot)%$(EXE))

bin/jeprof.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2909,6 +2909,7 @@ sub RemoveUninterestingFrames {
29092909
'@JEMALLOC_PREFIX@xallocx',
29102910
'@JEMALLOC_PREFIX@dallocx',
29112911
'@JEMALLOC_PREFIX@sdallocx',
2912+
'@JEMALLOC_PREFIX@sdallocx_noflags',
29122913
'tc_calloc',
29132914
'tc_cfree',
29142915
'tc_malloc',
@@ -5366,7 +5367,7 @@ sub GetProcedureBoundaries {
53665367
my $demangle_flag = "";
53675368
my $cppfilt_flag = "";
53685369
my $to_devnull = ">$dev_null 2>&1";
5369-
if (system(ShellEscape($nm, "--demangle", "image") . $to_devnull) == 0) {
5370+
if (system(ShellEscape($nm, "--demangle", $image) . $to_devnull) == 0) {
53705371
# In this mode, we do "nm --demangle <foo>"
53715372
$demangle_flag = "--demangle";
53725373
$cppfilt_flag = "";

configure.ac

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,9 @@ case "${host}" in
738738
libprefix=""
739739
SOREV="${so}"
740740
PIC_CFLAGS=""
741+
if test "${LG_SIZEOF_PTR}" = "3"; then
742+
default_retain="1"
743+
fi
741744
;;
742745
*)
743746
AC_MSG_RESULT([Unsupported operating system: ${host}])
@@ -851,6 +854,18 @@ if test "x${je_cv_format_printf}" = "xyes" ; then
851854
AC_DEFINE([JEMALLOC_HAVE_ATTR_FORMAT_PRINTF], [ ])
852855
fi
853856

857+
dnl Check for format_arg(...) attribute support.
858+
JE_CFLAGS_SAVE()
859+
JE_CFLAGS_ADD([-Werror])
860+
JE_CFLAGS_ADD([-herror_on_warning])
861+
JE_COMPILABLE([format(printf, ...) attribute], [#include <stdlib.h>],
862+
[const char * __attribute__((__format_arg__(1))) foo(const char *format);],
863+
[je_cv_format_arg])
864+
JE_CFLAGS_RESTORE()
865+
if test "x${je_cv_format_arg}" = "xyes" ; then
866+
AC_DEFINE([JEMALLOC_HAVE_ATTR_FORMAT_ARG], [ ])
867+
fi
868+
854869
dnl Support optional additions to rpath.
855870
AC_ARG_WITH([rpath],
856871
[AS_HELP_STRING([--with-rpath=<rpath>], [Colon-separated rpath (ELF systems only)])],
@@ -881,6 +896,19 @@ AC_PROG_RANLIB
881896
AC_PATH_PROG([LD], [ld], [false], [$PATH])
882897
AC_PATH_PROG([AUTOCONF], [autoconf], [false], [$PATH])
883898

899+
dnl Enable documentation
900+
AC_ARG_ENABLE([doc],
901+
[AS_HELP_STRING([--enable-documentation], [Build documentation])],
902+
if test "x$enable_doc" = "xno" ; then
903+
enable_doc="0"
904+
else
905+
enable_doc="1"
906+
fi
907+
,
908+
enable_doc="1"
909+
)
910+
AC_SUBST([enable_doc])
911+
884912
dnl Enable shared libs
885913
AC_ARG_ENABLE([shared],
886914
[AS_HELP_STRING([--enable-shared], [Build shared libaries])],
@@ -1406,22 +1434,22 @@ if test "x$enable_readlinkat" = "x1" ; then
14061434
fi
14071435
AC_SUBST([enable_readlinkat])
14081436

1409-
dnl Avoid the extra size checking by default
1410-
AC_ARG_ENABLE([extra-size-check],
1411-
[AS_HELP_STRING([--enable-extra-size-check],
1412-
[Perform additonal size related sanity checks])],
1413-
[if test "x$enable_extra_size_check" = "xno" ; then
1414-
enable_extra_size_check="0"
1437+
dnl Avoid extra safety checks by default
1438+
AC_ARG_ENABLE([opt-safety-checks],
1439+
[AS_HELP_STRING([--enable-opt-safety-checks],
1440+
[Perform certain low-overhead checks, even in opt mode])],
1441+
[if test "x$enable_opt_safety_checks" = "xno" ; then
1442+
enable_opt_safety_checks="0"
14151443
else
1416-
enable_extra_size_check="1"
1444+
enable_opt_safety_checks="1"
14171445
fi
14181446
],
1419-
[enable_extra_size_check="0"]
1447+
[enable_opt_safety_checks="0"]
14201448
)
1421-
if test "x$enable_extra_size_check" = "x1" ; then
1422-
AC_DEFINE([JEMALLOC_EXTRA_SIZE_CHECK], [ ])
1449+
if test "x$enable_opt_safety_checks" = "x1" ; then
1450+
AC_DEFINE([JEMALLOC_OPT_SAFETY_CHECKS], [ ])
14231451
fi
1424-
AC_SUBST([enable_extra_size_check])
1452+
AC_SUBST([enable_opt_safety_checks])
14251453

14261454
JE_COMPILABLE([a program using __builtin_unreachable], [
14271455
void foo (void) {
@@ -2357,6 +2385,7 @@ AC_MSG_RESULT([JEMALLOC_PRIVATE_NAMESPACE])
23572385
AC_MSG_RESULT([ : ${JEMALLOC_PRIVATE_NAMESPACE}])
23582386
AC_MSG_RESULT([install_suffix : ${install_suffix}])
23592387
AC_MSG_RESULT([malloc_conf : ${config_malloc_conf}])
2388+
AC_MSG_RESULT([documentation : ${enable_doc}])
23602389
AC_MSG_RESULT([shared libs : ${enable_shared}])
23612390
AC_MSG_RESULT([static libs : ${enable_static}])
23622391
AC_MSG_RESULT([autogen : ${enable_autogen}])

0 commit comments

Comments
 (0)