Navigation Menu

Skip to content

Commit

Permalink
Add --with-jemalloc option to use jemalloc for malloc()/free()
Browse files Browse the repository at this point in the history
It'll improve performance on multi-threading usage.
  • Loading branch information
kou committed Jan 24, 2015
1 parent 74f4543 commit 04364b5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions configure.ac
Expand Up @@ -914,6 +914,22 @@ if test "x$with_lz4" != "xno"; then
fi
fi

# jemalloc
AC_ARG_WITH(jemalloc,
[AS_HELP_STRING([--with-jemalloc],
[Use jemalloc for memory allocation. [default=no]])],
[with_jemalloc="$withval"],
[with_jemalloc="no"])
jemalloc_available="no"
if test "x$with_jemalloc" != "xno"; then
if test "x$with_jemalloc" != "xyes"; then
LDFLAGS="-L$with_jemalloc $LDFLAGS"
fi
AC_SEARCH_LIBS(mallocx, jemalloc,
[jemalloc_available="yes"],
[AC_MSG_ERROR("No libjemalloc found")])
fi

# MeCab
# NOTE: MUST be checked last
AC_ARG_WITH(mecab,
Expand Down Expand Up @@ -1596,6 +1612,7 @@ if test "x$message_pack_available" = "xyes"; then
echo " LIBS: ${MESSAGE_PACK_LIBS}"
fi
echo " mruby: $enable_mruby"
echo " jemalloc: $jemalloc_available"
echo

echo "groonga-httpd:"
Expand Down

0 comments on commit 04364b5

Please sign in to comment.