about summary refs log tree commit diff
path: root/malloc/arena.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2019-08-08 19:09:43 -0400
committerDJ Delorie <dj@redhat.com>2019-08-09 14:04:03 -0400
commitc48d92b430c480de06762f80c104922239416826 (patch)
treeefb687b05fe7b94025ad29c6fe35d1d60a336fb8 /malloc/arena.c
parentb6d2c4475d5abc05dd009575b90556bdd3c78ad0 (diff)
downloadglibc-c48d92b430c480de06762f80c104922239416826.tar.gz
glibc-c48d92b430c480de06762f80c104922239416826.tar.xz
glibc-c48d92b430c480de06762f80c104922239416826.zip
Add glibc.malloc.mxfast tunable
* elf/dl-tunables.list: Add glibc.malloc.mxfast.
* manual/tunables.texi: Document it.
* malloc/malloc.c (do_set_mxfast): New.
(__libc_mallopt): Call it.
* malloc/arena.c: Add mxfast tunable.
* malloc/tst-mxfast.c: New.
* malloc/Makefile: Add it.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'malloc/arena.c')
-rw-r--r--malloc/arena.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/malloc/arena.c b/malloc/arena.c
index 8309c1334c..a32eb403ec 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -236,6 +236,7 @@ TUNABLE_CALLBACK_FNDECL (set_tcache_max, size_t)
 TUNABLE_CALLBACK_FNDECL (set_tcache_count, size_t)
 TUNABLE_CALLBACK_FNDECL (set_tcache_unsorted_limit, size_t)
 #endif
+TUNABLE_CALLBACK_FNDECL (set_mxfast, size_t)
 #else
 /* Initialization routine. */
 #include <string.h>
@@ -323,6 +324,7 @@ ptmalloc_init (void)
   TUNABLE_GET (tcache_unsorted_limit, size_t,
 	       TUNABLE_CALLBACK (set_tcache_unsorted_limit));
 # endif
+  TUNABLE_GET (mxfast, size_t, TUNABLE_CALLBACK (set_mxfast));
 #else
   const char *s = NULL;
   if (__glibc_likely (_environ != NULL))