Remove the sysv option.
This commit is contained in:
parent
f081b88dfb
commit
c90ad71237
5
INSTALL
5
INSTALL
@ -108,11 +108,6 @@ any of the following arguments (not a definitive list) to 'configure':
|
||||
errors, as is commonly implemented by "xmalloc" wrapper function for malloc.
|
||||
See the "opt.xmalloc" option documentation for usage details.
|
||||
|
||||
--enable-sysv
|
||||
Enable support for System V semantics, wherein malloc(0) returns NULL
|
||||
rather than a minimal allocation. See the "opt.sysv" option documentation
|
||||
for usage details.
|
||||
|
||||
--enable-lazy-lock
|
||||
Enable code that wraps pthread_create() to detect when an application
|
||||
switches from single-threaded to multi-threaded mode, so that it can avoid
|
||||
|
17
configure.ac
17
configure.ac
@ -626,22 +626,6 @@ if test "x$enable_xmalloc" = "x1" ; then
|
||||
fi
|
||||
AC_SUBST([enable_xmalloc])
|
||||
|
||||
dnl Do not support the SYSV option by default.
|
||||
AC_ARG_ENABLE([sysv],
|
||||
[AS_HELP_STRING([--enable-sysv], [Support SYSV semantics option])],
|
||||
[if test "x$enable_sysv" = "xno" ; then
|
||||
enable_sysv="0"
|
||||
else
|
||||
enable_sysv="1"
|
||||
fi
|
||||
],
|
||||
[enable_sysv="0"]
|
||||
)
|
||||
if test "x$enable_sysv" = "x1" ; then
|
||||
AC_DEFINE([JEMALLOC_SYSV], [ ])
|
||||
fi
|
||||
AC_SUBST([enable_sysv])
|
||||
|
||||
AC_MSG_CHECKING([STATIC_PAGE_SHIFT])
|
||||
AC_RUN_IFELSE([AC_LANG_PROGRAM(
|
||||
[[#include <stdio.h>
|
||||
@ -911,7 +895,6 @@ AC_MSG_RESULT([prof-gcc : ${enable_prof_gcc}])
|
||||
AC_MSG_RESULT([tcache : ${enable_tcache}])
|
||||
AC_MSG_RESULT([fill : ${enable_fill}])
|
||||
AC_MSG_RESULT([xmalloc : ${enable_xmalloc}])
|
||||
AC_MSG_RESULT([sysv : ${enable_sysv}])
|
||||
AC_MSG_RESULT([dss : ${enable_dss}])
|
||||
AC_MSG_RESULT([dynamic_page_shift : ${enable_dynamic_page_shift}])
|
||||
AC_MSG_RESULT([lazy_lock : ${enable_lazy_lock}])
|
||||
|
@ -662,16 +662,6 @@ for (i = 0; i < nbins; i++) {
|
||||
build configuration.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<mallctl>config.sysv</mallctl>
|
||||
(<type>bool</type>)
|
||||
<literal>r-</literal>
|
||||
</term>
|
||||
<listitem><para><option>--enable-sysv</option> was specified during
|
||||
build configuration.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<mallctl>config.tcache</mallctl>
|
||||
@ -808,22 +798,6 @@ for (i = 0; i < nbins; i++) {
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="opt.sysv">
|
||||
<term>
|
||||
<mallctl>opt.sysv</mallctl>
|
||||
(<type>bool</type>)
|
||||
<literal>r-</literal>
|
||||
[<option>--enable-sysv</option>]
|
||||
</term>
|
||||
<listitem><para>If enabled, attempting to allocate zero bytes will
|
||||
return a <constant>NULL</constant> pointer instead of a valid pointer.
|
||||
(The default behavior is to make a minimal allocation and return a
|
||||
pointer to it.) This option is provided for System V compatibility.
|
||||
This option is incompatible with the <link
|
||||
linkend="opt.xmalloc"><mallctl>opt.xmalloc</mallctl></link> option.
|
||||
This option is disabled by default.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="opt.xmalloc">
|
||||
<term>
|
||||
<mallctl>opt.xmalloc</mallctl>
|
||||
|
@ -104,13 +104,6 @@ static const bool config_stats =
|
||||
false
|
||||
#endif
|
||||
;
|
||||
static const bool config_sysv =
|
||||
#ifdef JEMALLOC_SYSV
|
||||
true
|
||||
#else
|
||||
false
|
||||
#endif
|
||||
;
|
||||
static const bool config_tcache =
|
||||
#ifdef JEMALLOC_TCACHE
|
||||
true
|
||||
@ -385,7 +378,6 @@ typedef struct {
|
||||
|
||||
extern bool opt_abort;
|
||||
extern bool opt_junk;
|
||||
extern bool opt_sysv;
|
||||
extern bool opt_xmalloc;
|
||||
extern bool opt_zero;
|
||||
extern size_t opt_narenas;
|
||||
|
@ -98,9 +98,6 @@
|
||||
/* Support optional abort() on OOM. */
|
||||
#undef JEMALLOC_XMALLOC
|
||||
|
||||
/* Support SYSV semantics. */
|
||||
#undef JEMALLOC_SYSV
|
||||
|
||||
/* Support lazy locking (avoid locking unless a second thread is launched). */
|
||||
#undef JEMALLOC_LAZY_LOCK
|
||||
|
||||
|
@ -53,7 +53,6 @@ CTL_PROTO(config_prof)
|
||||
CTL_PROTO(config_prof_libgcc)
|
||||
CTL_PROTO(config_prof_libunwind)
|
||||
CTL_PROTO(config_stats)
|
||||
CTL_PROTO(config_sysv)
|
||||
CTL_PROTO(config_tcache)
|
||||
CTL_PROTO(config_tls)
|
||||
CTL_PROTO(config_xmalloc)
|
||||
@ -64,7 +63,6 @@ CTL_PROTO(opt_lg_dirty_mult)
|
||||
CTL_PROTO(opt_stats_print)
|
||||
CTL_PROTO(opt_junk)
|
||||
CTL_PROTO(opt_zero)
|
||||
CTL_PROTO(opt_sysv)
|
||||
CTL_PROTO(opt_xmalloc)
|
||||
CTL_PROTO(opt_tcache)
|
||||
CTL_PROTO(opt_lg_tcache_gc_sweep)
|
||||
@ -174,7 +172,6 @@ static const ctl_node_t config_node[] = {
|
||||
{NAME("prof_libgcc"), CTL(config_prof_libgcc)},
|
||||
{NAME("prof_libunwind"), CTL(config_prof_libunwind)},
|
||||
{NAME("stats"), CTL(config_stats)},
|
||||
{NAME("sysv"), CTL(config_sysv)},
|
||||
{NAME("tcache"), CTL(config_tcache)},
|
||||
{NAME("tls"), CTL(config_tls)},
|
||||
{NAME("xmalloc"), CTL(config_xmalloc)}
|
||||
@ -188,7 +185,6 @@ static const ctl_node_t opt_node[] = {
|
||||
{NAME("stats_print"), CTL(opt_stats_print)},
|
||||
{NAME("junk"), CTL(opt_junk)},
|
||||
{NAME("zero"), CTL(opt_zero)},
|
||||
{NAME("sysv"), CTL(opt_sysv)},
|
||||
{NAME("xmalloc"), CTL(opt_xmalloc)},
|
||||
{NAME("tcache"), CTL(opt_tcache)},
|
||||
{NAME("lg_tcache_gc_sweep"), CTL(opt_lg_tcache_gc_sweep)},
|
||||
@ -1058,7 +1054,6 @@ CTL_RO_BOOL_CONFIG_GEN(config_prof)
|
||||
CTL_RO_BOOL_CONFIG_GEN(config_prof_libgcc)
|
||||
CTL_RO_BOOL_CONFIG_GEN(config_prof_libunwind)
|
||||
CTL_RO_BOOL_CONFIG_GEN(config_stats)
|
||||
CTL_RO_BOOL_CONFIG_GEN(config_sysv)
|
||||
CTL_RO_BOOL_CONFIG_GEN(config_tcache)
|
||||
CTL_RO_BOOL_CONFIG_GEN(config_tls)
|
||||
CTL_RO_BOOL_CONFIG_GEN(config_xmalloc)
|
||||
@ -1072,7 +1067,6 @@ CTL_RO_NL_GEN(opt_lg_dirty_mult, opt_lg_dirty_mult, ssize_t)
|
||||
CTL_RO_NL_GEN(opt_stats_print, opt_stats_print, bool)
|
||||
CTL_RO_NL_CGEN(config_fill, opt_junk, opt_junk, bool)
|
||||
CTL_RO_NL_CGEN(config_fill, opt_zero, opt_zero, bool)
|
||||
CTL_RO_NL_CGEN(config_sysv, opt_sysv, opt_sysv, bool)
|
||||
CTL_RO_NL_CGEN(config_xmalloc, opt_xmalloc, opt_xmalloc, bool)
|
||||
CTL_RO_NL_CGEN(config_tcache, opt_tcache, opt_tcache, bool)
|
||||
CTL_RO_NL_CGEN(config_tcache, opt_lg_tcache_gc_sweep, opt_lg_tcache_gc_sweep,
|
||||
|
@ -48,7 +48,6 @@ bool opt_junk = false;
|
||||
bool opt_abort = false;
|
||||
bool opt_junk = false;
|
||||
#endif
|
||||
bool opt_sysv = false;
|
||||
bool opt_xmalloc = false;
|
||||
bool opt_zero = false;
|
||||
size_t opt_narenas = 0;
|
||||
@ -575,9 +574,6 @@ malloc_conf_init(void)
|
||||
CONF_HANDLE_BOOL(junk)
|
||||
CONF_HANDLE_BOOL(zero)
|
||||
}
|
||||
if (config_sysv) {
|
||||
CONF_HANDLE_BOOL(sysv)
|
||||
}
|
||||
if (config_xmalloc) {
|
||||
CONF_HANDLE_BOOL(xmalloc)
|
||||
}
|
||||
@ -854,19 +850,8 @@ JEMALLOC_P(malloc)(size_t size)
|
||||
goto OOM;
|
||||
}
|
||||
|
||||
if (size == 0) {
|
||||
if (config_sysv == false || opt_sysv == false)
|
||||
size = 1;
|
||||
else {
|
||||
if (config_xmalloc && opt_xmalloc) {
|
||||
malloc_write("<jemalloc>: Error in malloc(): "
|
||||
"invalid size 0\n");
|
||||
abort();
|
||||
}
|
||||
ret = NULL;
|
||||
goto RETURN;
|
||||
}
|
||||
}
|
||||
if (size == 0)
|
||||
size = 1;
|
||||
|
||||
if (config_prof && opt_prof) {
|
||||
usize = s2u(size);
|
||||
@ -931,22 +916,8 @@ imemalign(void **memptr, size_t alignment, size_t size)
|
||||
if (malloc_init())
|
||||
result = NULL;
|
||||
else {
|
||||
if (size == 0) {
|
||||
if (config_sysv == false || opt_sysv == false)
|
||||
size = 1;
|
||||
else {
|
||||
if (config_xmalloc && opt_xmalloc) {
|
||||
malloc_write("<jemalloc>: Error in "
|
||||
"posix_memalign(): invalid size "
|
||||
"0\n");
|
||||
abort();
|
||||
}
|
||||
result = NULL;
|
||||
*memptr = NULL;
|
||||
ret = 0;
|
||||
goto RETURN;
|
||||
}
|
||||
}
|
||||
if (size == 0)
|
||||
size = 1;
|
||||
|
||||
/* Make sure that alignment is a large enough power of 2. */
|
||||
if (((alignment - 1) & alignment) != 0
|
||||
@ -1047,8 +1018,7 @@ JEMALLOC_P(calloc)(size_t num, size_t size)
|
||||
|
||||
num_size = num * size;
|
||||
if (num_size == 0) {
|
||||
if ((config_sysv == false || opt_sysv == false)
|
||||
&& ((num == 0) || (size == 0)))
|
||||
if (num == 0 || size == 0)
|
||||
num_size = 1;
|
||||
else {
|
||||
ret = NULL;
|
||||
@ -1135,18 +1105,8 @@ JEMALLOC_P(realloc)(void *ptr, size_t size)
|
||||
idalloc(ptr);
|
||||
ret = NULL;
|
||||
goto RETURN;
|
||||
} else {
|
||||
if (config_sysv == false || opt_sysv == false)
|
||||
size = 1;
|
||||
else {
|
||||
if (config_prof && opt_prof) {
|
||||
old_ctx = NULL;
|
||||
cnt = NULL;
|
||||
}
|
||||
ret = NULL;
|
||||
goto RETURN;
|
||||
}
|
||||
}
|
||||
} else
|
||||
size = 1;
|
||||
}
|
||||
|
||||
if (ptr != NULL) {
|
||||
|
@ -489,7 +489,6 @@ stats_print(void (*write_cb)(void *, const char *), void *cbopaque,
|
||||
OPT_WRITE_BOOL(stats_print)
|
||||
OPT_WRITE_BOOL(junk)
|
||||
OPT_WRITE_BOOL(zero)
|
||||
OPT_WRITE_BOOL(sysv)
|
||||
OPT_WRITE_BOOL(xmalloc)
|
||||
OPT_WRITE_BOOL(tcache)
|
||||
OPT_WRITE_SSIZE_T(lg_tcache_gc_sweep)
|
||||
|
Loading…
Reference in New Issue
Block a user