diff --git a/INSTALL b/INSTALL index 0ddcacb7..f9c8a369 100644 --- a/INSTALL +++ b/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 diff --git a/configure.ac b/configure.ac index 91caef46..3fa24919 100644 --- a/configure.ac +++ b/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 @@ -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}]) diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in index cfe120fb..e7cc6284 100644 --- a/doc/jemalloc.xml.in +++ b/doc/jemalloc.xml.in @@ -662,16 +662,6 @@ for (i = 0; i < nbins; i++) { build configuration. - - - config.sysv - (bool) - r- - - was specified during - build configuration. - - config.tcache @@ -808,22 +798,6 @@ for (i = 0; i < nbins; i++) { - - - opt.sysv - (bool) - r- - [] - - If enabled, attempting to allocate zero bytes will - return a NULL 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 opt.xmalloc option. - This option is disabled by default. - - opt.xmalloc diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in index f43fcd20..35c05f4e 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -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; diff --git a/include/jemalloc/jemalloc_defs.h.in b/include/jemalloc/jemalloc_defs.h.in index 53e85208..1360364a 100644 --- a/include/jemalloc/jemalloc_defs.h.in +++ b/include/jemalloc/jemalloc_defs.h.in @@ -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 diff --git a/src/ctl.c b/src/ctl.c index 0beeb3d0..0fabd852 100644 --- a/src/ctl.c +++ b/src/ctl.c @@ -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, diff --git a/src/jemalloc.c b/src/jemalloc.c index 865c6236..cc0188c1 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -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(": 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(": 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) { diff --git a/src/stats.c b/src/stats.c index e4500dfb..f6851a01 100644 --- a/src/stats.c +++ b/src/stats.c @@ -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)