Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin J. Thompson
Tor
Commits
bb1f2942
Commit
bb1f2942
authored
6 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge branch 'with_malloc_squashed'
parents
ae157b79
abde9fb4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/ticket20424
+5
-0
5 additions, 0 deletions
changes/ticket20424
configure.ac
+60
-11
60 additions, 11 deletions
configure.ac
with
65 additions
and
11 deletions
changes/ticket20424
0 → 100644
+
5
−
0
View file @
bb1f2942
o Minor features (compilation):
- Tor's configure script now supports a --with-malloc= option to select
your malloc implementation. Supported options are "tcmalloc",
"jemalloc", "openbsd", and "system" (the default). Addresses part of
ticket 20424. Based on a patch from Alex Xu.
This diff is collapsed.
Click to expand it.
configure.ac
+
60
−
11
View file @
bb1f2942
...
...
@@ -82,8 +82,6 @@ if test "$enable_memory_sentinels" = "no"; then
[Defined if we're turning off memory safety code to look for bugs])
fi
AM_CONDITIONAL(USE_OPENBSD_MALLOC, test "x$enable_openbsd_malloc" = "xyes")
AC_ARG_ENABLE(asciidoc,
AS_HELP_STRING(--disable-asciidoc, [don't use asciidoc (disables building of manpages)]),
[case "${enableval}" in
...
...
@@ -1793,19 +1791,70 @@ AC_ARG_WITH(tcmalloc,
AS_HELP_STRING(--with-tcmalloc, [use tcmalloc memory allocation library]),
[ tcmalloc=yes ], [ tcmalloc=no ])
if test "x$tcmalloc" = "xyes"; then
LDFLAGS="-ltcmalloc $LDFLAGS"
fi
default_malloc=system
using_custom_malloc=no
if test "x$
enable
_
openbsd
_
malloc
" = "xyes"; then
using_custom
_malloc=
yes
if test "x$enable_openbsd_malloc" = "xyes" ; then
AC_MSG_NOTICE([The --
enable
-
openbsd
-
malloc
argument is deprecated; use --with-malloc=openbsd instead.])
default
_malloc=
openbsd
fi
if test "x$tcmalloc" = "xyes"; then
using_custom_malloc=yes
AC_MSG_NOTICE([The --with-tcmalloc argument is deprecated; use --with-malloc=tcmalloc instead.])
default_malloc=tcmalloc
fi
if test "$using_custom_malloc" = "no"; then
AC_CHECK_FUNCS(mallinfo)
AC_ARG_WITH(malloc,
AS_HELP_STRING([--with-malloc=[system,jemalloc,tcmalloc,openbsd]],
[select special malloc implementation [system]]),
[ malloc="$with_malloc" ], [ malloc="$default_malloc" ])
AS_CASE([$malloc],
[tcmalloc], [
PKG_CHECK_MODULES([TCMALLOC],
[libtcmalloc],
have_tcmalloc=yes,
have_tcmalloc=no)
if test "x$have_tcmalloc" = "xno" ; then
AC_MSG_ERROR([Unable to find tcmalloc requested by --with-malloc.])
fi
CFLAGS="$CFLAGS $TCMALLOC_CFLAGS"
LIBS="$TCMALLOC_LIBS $LIBS"
],
[jemalloc], [
PKG_CHECK_MODULES([JEMALLOC],
[jemalloc],
have_jemalloc=yes,
have_jemalloc=no)
if test "x$have_tcmalloc" = "xno" ; then
AC_MSG_ERROR([Unable to find jemalloc requested by --with-malloc.])
fi
CFLAGS="$CFLAGS $JEMALLOC_CFLAGS"
LIBS="$JEMALLOC_LIBS $LIBS"
using_custom_malloc=yes
],
[openbsd], [
enable_openbsd_malloc=yes
],
[system], [
# handle this later, including the jemalloc fallback
AC_CHECK_FUNCS(mallinfo)
],
[AC_MSG_ERROR([--with-malloc=`$with_malloc' not supported, see --help])
])
AM_CONDITIONAL(USE_OPENBSD_MALLOC, test "x$enable_openbsd_malloc" = "xyes")
if test "$malloc" != "system"; then
# Tell the C compiler not to use the system allocator functions.
TOR_CHECK_CFLAGS([-fno-builtin-malloc -fno-builtin-realloc -fno-builtin-calloc -fno-builtin-free])
fi
if test "$using_custom_malloc" = "yes"; then
# Tell the C compiler not to use the system allocator functions.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment