summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-12-17 20:21:18 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2015-12-17 20:35:21 +0100
commit73490b63e659336596420a263c3a7133ccfd914b (patch)
treeb85f3c9155f1972bb0f8d2942bf9ecefc7e3ec4a
parent7ccac5e8a4a0fd123eb8c035225ee12d30c0bb00 (diff)
reduce stack cache size to save memory space
Idea from different projects as OpenWrt and others. https://lists.openwrt.org/pipermail/openwrt-devel/2013-November/022299.html https://github.com/wl500g/toolchain/blob/master/toolchain/uClibc/patches/0.9.32/980-stack-cache-maxsize.patch
-rw-r--r--libpthread/nptl/allocatestack.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libpthread/nptl/allocatestack.c b/libpthread/nptl/allocatestack.c
index 118820a9a..bf9925253 100644
--- a/libpthread/nptl/allocatestack.c
+++ b/libpthread/nptl/allocatestack.c
@@ -98,8 +98,12 @@
/* Cache handling for not-yet free stacks. */
-/* Maximum size in kB of cache. */
-static size_t stack_cache_maxsize = 40 * 1024 * 1024; /* 40MiBi by default. */
+/*
+ Maximum size in kB of cache. GNU libc default is 40MiB
+ embedded systems don't have enough ram for big dirty stack caches,
+ reduce it to 16MiB. 4 does not work, f.e. tst-kill4 segfaults.
+*/
+static size_t stack_cache_maxsize = 16 * 1024 * 1024;
static size_t stack_cache_actsize;
/* Mutex protecting this variable. */