Skip to content

Commit

Permalink
Revert "Merge pull request mono#5643 from alexanderkyte/jemalloc"
Browse files Browse the repository at this point in the history
This reverts commit 3dac926, reversing
changes made to 50b6a2e.
  • Loading branch information
alexischr committed Dec 5, 2017
1 parent 3dac926 commit 233212b
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 200 deletions.
60 changes: 11 additions & 49 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ extra_runtime_ldflags=""
# Hack for WASM
# Current autotools (v1.15) doesn't have a triplet we can use for wasm so the kludge we do is to
# work around it by using a feature flag instead
AC_ARG_ENABLE(wasm,[ --enable-wasm Hack to set the current runtime to target wasm], enable_wasm=$enableval)
AC_ARG_ENABLE(wasm,[ --enable-wasm Hack to set the current runtime to target wasm], enable_wasm=$enableval)

# Thread configuration inspired by sleepycat's db
AC_MSG_CHECKING([host platform characteristics])
Expand Down Expand Up @@ -913,51 +913,6 @@ if test $csc_compiler = default; then
fi
AC_MSG_RESULT($csc_compiler)

AC_ARG_WITH(jemalloc, [ --with-jemalloc=yes,no If jemalloc is enabled (defaults to no)], [], [with_jemalloc=no])
AC_ARG_WITH(jemalloc-always, [ --with-jemalloc_always=yes,no If jemalloc is enabled and always used (defaults to yes)], [], [with_jemalloc_always=yes])
AC_ARG_WITH(jemalloc-assert, [ --with-jemalloc_assert=yes,no If jemalloc performs runtime checks for memory correctness (defaults to no)], [], [with_jemalloc_assert=no])


if test x$target_win32 = xyes; then
with_jemalloc=no
with_jemalloc_assert=no
with_jemalloc_always=no
fi

AM_CONDITIONAL(MONO_JEMALLOC_ASSERT, [test "x$with_jemalloc_assert" = "xyes"])
if test "x$with_jemalloc_assert" = "xyes"; then
JEMALLOC_CFLAGS+=" -DMONO_JEMALLOC_ASSERT"
AC_DEFINE(MONO_JEMALLOC_ASSERT, 1, [Make jemalloc assert for mono])
AC_SUBST(MONO_JEMALLOC_ASSERT, 1)
fi

AM_CONDITIONAL(MONO_JEMALLOC_DEFAULT, [test "x$with_jemalloc_always" = "xyes"])
if test "x$with_jemalloc_always" = "xyes"; then
with_jemalloc=yes
JEMALLOC_CFLAGS+=" -DMONO_JEMALLOC_DEFAULT"
AC_DEFINE(MONO_JEMALLOC_DEFAULT, 1, [Make jemalloc default for mono])
AC_SUBST(MONO_JEMALLOC_DEFAULT, 1)
fi

AM_CONDITIONAL(MONO_JEMALLOC_ENABLED, [test "x$with_jemalloc" = "xyes"])
if test "x$with_jemalloc" = "xyes"; then
JEMALLOC_LDFLAGS="-L`pwd`/mono/utils/jemalloc/jemalloc/lib -ljemalloc_pic"
JEMALLOC_CFLAGS+=" -DMONO_JEMALLOC_ENABLED -I `pwd`/mono/utils/jemalloc/jemalloc/include"
JEMALLOC_AUTOCONF_FLAGS=" --build=$target --host=$host"

if test "x$target_mach" = "xyes"; then
JEMALLOC_CPPFLAGS=" -stdlib=libc++ "
fi

AC_DEFINE(MONO_JEMALLOC_ENABLED, 1, [Enable jemalloc usage for mono])
AC_SUBST(MONO_JEMALLOC_ENABLED, 1)

AC_SUBST(JEMALLOC_CFLAGS)
AC_SUBST(JEMALLOC_CPPFLAGS)
AC_SUBST(JEMALLOC_LDFLAGS)
AC_SUBST(JEMALLOC_AUTOCONF_FLAGS)
fi

#
# Set the build profiles and options before things which use them
#
Expand Down Expand Up @@ -3928,6 +3883,15 @@ AC_CHECK_FUNCS(strlcpy stpcpy strtok_r rewinddir vasprintf strerror_r)
AC_CHECK_FUNCS(getrlimit)
AC_CHECK_FUNCS(fork execv execve)

AC_ARG_WITH([overridable-allocators], [ --with-overridable-allocators allow g_*alloc/g_free to call custom allocators set via g_mem_set_vtable])

if test x$with_overridable_allocators = xyes; then
AC_DEFINE(ENABLE_OVERRIDABLE_ALLOCATORS,1,[Overridable allocator support enabled])
AC_MSG_NOTICE([Overridable allocator support enabled])
else
AC_MSG_NOTICE([Overridable allocator support disabled])
fi

#
# Mono currently supports 10.6, but strndup is not available prior to 10.7; avoiding
# the detection of strndup on OS X so Mono built on 10.7+ still runs on 10.6. This can be
Expand All @@ -3941,7 +3905,7 @@ elif test x$target_ios = xno; then
AC_CHECK_FUNCS(strndup getpwuid_r)
fi

AM_CONDITIONAL(NEED_VASPRINTF, true)
AM_CONDITIONAL(NEED_VASPRINTF, test x$ac_cv_func_vasprintf = xno || test x$with_overridable_allocators = xyes)
AM_ICONV()
AC_SEARCH_LIBS(sqrtf, m)

Expand Down Expand Up @@ -4730,7 +4694,6 @@ scripts/mono-find-requires
mono/Makefile
mono/btls/Makefile
mono/utils/Makefile
mono/utils/jemalloc/Makefile
mono/metadata/Makefile
mono/dis/Makefile
mono/cil/Makefile
Expand Down Expand Up @@ -4970,7 +4933,6 @@ echo "
libgdiplus: $libgdiplus_msg
zlib: $zlib_msg
BTLS: $enable_btls$btls_platform_string
jemalloc: $with_jemalloc (always use: $with_jemalloc_always)
$disabled
"
if test x$with_static_mono = xno -a "x$host_win32" != "xyes"; then
Expand Down
4 changes: 2 additions & 2 deletions mono/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ monotouch-do-clean:
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
done;
else
SUBDIRS = $(btls_dirs) eglib arch utils cil metadata $(sgen_dirs) mini dis tests unit-tests benchmark profiler
SUBDIRS = $(btls_dirs) eglib arch utils cil metadata $(sgen_dirs) mini dis tests unit-tests benchmark profiler
endif
endif
DIST_SUBDIRS = btls eglib arch utils cil metadata $(sgen_dirs) mini dis tests unit-tests benchmark profiler
DIST_SUBDIRS = btls eglib arch utils cil metadata $(sgen_dirs) mini dis tests unit-tests benchmark profiler
6 changes: 0 additions & 6 deletions mono/mini/Makefile.am.in
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ AM_CFLAGS = \
-I$(top_srcdir) \
$(GLIB_CFLAGS) \
$(LLVM_CFLAGS) \
$(JEMALLOC_CFLAGS) \
$(PLATFORM_CFLAGS) $(ARCH_CFLAGS) $(SHARED_CFLAGS)

AM_CXXFLAGS = $(LLVM_CXXFLAGS) $(GLIB_CFLAGS)
Expand Down Expand Up @@ -636,11 +635,6 @@ os_sources = $(darwin_sources) $(posix_sources)
monobin_platform_ldflags=-framework CoreFoundation -framework Foundation
endif

if MONO_JEMALLOC_ENABLED
libmonoldflags += $(JEMALLOC_LDFLAGS)
mono_CFLAGS += $(JEMALLOC_CFLAGS)
endif

libmini_la_SOURCES = $(common_sources) $(llvm_sources) $(llvm_runtime_sources) $(interp_sources) $(arch_sources) $(os_sources)
libmini_la_CFLAGS = $(mono_CFLAGS)

Expand Down
14 changes: 0 additions & 14 deletions mono/mini/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1824,20 +1824,6 @@ mono_main (int argc, char* argv[])

if (g_hasenv ("MONO_NO_SMP"))
mono_set_use_smp (FALSE);

#ifdef MONO_JEMALLOC_ENABLED

gboolean use_jemalloc = FALSE;
#ifdef MONO_JEMALLOC_DEFAULT
use_jemalloc = TRUE;
#endif
if (!use_jemalloc)
use_jemalloc = g_hasenv ("MONO_USE_JEMALLOC");

if (use_jemalloc)
mono_init_jemalloc ();

#endif

g_log_set_always_fatal (G_LOG_LEVEL_ERROR);
g_log_set_fatal_mask (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR);
Expand Down
1 change: 0 additions & 1 deletion mono/mini/mini.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <mono/utils/mono-threads-coop.h>
#include <mono/utils/mono-tls.h>
#include <mono/utils/atomic.h>
#include <mono/utils/mono-jemalloc.h>
#include <mono/utils/mono-conc-hashtable.h>
#include <mono/utils/mono-signal-handler.h>

Expand Down
9 changes: 0 additions & 9 deletions mono/utils/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ monoutils_sources = \
mono-proclib.h \
mono-proclib-windows-internals.h \
mono-publib.c \
mono-jemalloc.c \
mono-string.h \
mono-time.c \
mono-time.h \
Expand Down Expand Up @@ -263,21 +262,13 @@ arch_sources += mono-hwcap-cross.c
endif

libmonoutils_la_SOURCES = $(monoutils_sources) $(arch_sources)
libmonoutils_la_CFLAGS = $(JEMALLOC_CFLAGS)
libmonoutils_la_LDFLAGS = $(JEMALLOC_LDFLAGS)
libmonoutilsincludedir = $(includedir)/mono-$(API_VER)/mono/utils

libmonoutilsinclude_HEADERS = \
mono-logger.h \
mono-error.h \
mono-publib.h \
mono-jemalloc.h \
mono-dl-fallback.h \
mono-counters.h

EXTRA_DIST = mono-embed.h mono-embed.c

if MONO_JEMALLOC_ENABLED
SUBDIRS = jemalloc
DIST_SUBDIRS = jemalloc
endif
3 changes: 0 additions & 3 deletions mono/utils/jemalloc/.gitignore

This file was deleted.

49 changes: 0 additions & 49 deletions mono/utils/jemalloc/Makefile.am

This file was deleted.

10 changes: 0 additions & 10 deletions mono/utils/jemalloc/SUBMODULES.json

This file was deleted.

19 changes: 0 additions & 19 deletions mono/utils/mono-jemalloc.c

This file was deleted.

36 changes: 0 additions & 36 deletions mono/utils/mono-jemalloc.h

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/ci/run-jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ if [[ $CI_TAGS == *'retry-flaky-tests'* ]]; then
export MONO_FLAKY_TEST_RETRIES=5
fi

if [[ ${label} == 'osx-i386' ]]; then CFLAGS="$CFLAGS -m32 -arch=i386"; LDFLAGS="-m32 -arch=i386"; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib --host=i386-apple-darwin11.2.0 --build=i386-apple-darwin11.2.0"; fi
if [[ ${label} == 'osx-amd64' ]]; then CFLAGS="$CFLAGS -m64 -arch x86_64"; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib"; fi
if [[ ${label} == 'osx-i386' ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib --build=i386-apple-darwin11.2.0"; fi
if [[ ${label} == 'osx-amd64' ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib "; fi
if [[ ${label} == 'w32' ]]; then PLATFORM=Win32; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --host=i686-w64-mingw32"; export MONO_EXECUTABLE="${MONO_REPO_ROOT}/msvc/build/sgen/Win32/bin/Release/mono-sgen.exe"; fi
if [[ ${label} == 'w64' ]]; then PLATFORM=x64; EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --host=x86_64-w64-mingw32 --disable-boehm"; export MONO_EXECUTABLE="${MONO_REPO_ROOT}/msvc/build/sgen/x64/bin/Release/mono-sgen.exe"; fi

Expand Down

0 comments on commit 233212b

Please sign in to comment.