1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

version.c: show malloc_conf

* configure.in (jemalloc): check for the header regardless drop-in
  libjemalloc is found, for `malloc_conf` declaration.
* version.c (ruby_show_version): show `malloc_conf` if set.
  [Feature #9113]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-06-05 05:36:28 +00:00
parent 6ab08d2e8d
commit a4d7e42888
3 changed files with 14 additions and 7 deletions

View file

@ -1,4 +1,10 @@
Thu Jun 5 14:16:41 2014 Nobuyoshi Nakada <nobu@ruby-lang.org> Thu Jun 5 14:36:24 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (jemalloc): check for the header regardless drop-in
libjemalloc is found, for `malloc_conf` declaration.
* version.c (ruby_show_version): show `malloc_conf` if set.
[Feature #9113]
* configure.in (with-jemalloc): also check for header, for ABIs * configure.in (with-jemalloc): also check for header, for ABIs
which JEMALLOC_MANGLE is needed, i.e., Mach-O and PE-COFF which JEMALLOC_MANGLE is needed, i.e., Mach-O and PE-COFF

View file

@ -1178,13 +1178,11 @@ AC_ARG_WITH([jemalloc],
[with_jemalloc=yes], [with_jemalloc=no]) [with_jemalloc=yes], [with_jemalloc=no])
AS_IF([test "x$with_jemalloc" = xyes],[ AS_IF([test "x$with_jemalloc" = xyes],[
AC_CHECK_LIB([jemalloc],[malloc_conf],[], [with_jemalloc=no]) AC_CHECK_LIB([jemalloc],[malloc_conf],[], [with_jemalloc=no])
AS_IF([test "x$with_jemalloc" != xyes],[
AC_CHECK_HEADER(jemalloc/jemalloc.h, [ AC_CHECK_HEADER(jemalloc/jemalloc.h, [
AC_DEFINE(RUBY_ALTERNATIVE_MALLOC_HEADER, [<jemalloc/jemalloc.h>]) AC_DEFINE(RUBY_ALTERNATIVE_MALLOC_HEADER, [<jemalloc/jemalloc.h>])
AC_DEFINE(JEMALLOC_MANGLE) AC_DEFINE(JEMALLOC_MANGLE)
with_jemalloc=yes with_jemalloc=yes
]) ])
])
AS_IF([test "x$with_jemalloc" = xyes], AS_IF([test "x$with_jemalloc" = xyes],
[ [
ac_cv_func_malloc_usable_size=yes ac_cv_func_malloc_usable_size=yes

View file

@ -78,6 +78,9 @@ void
ruby_show_version(void) ruby_show_version(void)
{ {
PRINT(description); PRINT(description);
#ifdef HAVE_MALLOC_CONF
if (malloc_conf) printf("malloc_conf=%s\n", malloc_conf);
#endif
fflush(stdout); fflush(stdout);
} }