diff options
author | Ben Wolsieffer <ben.wolsieffer@hefring.com> | 2023-11-02 11:48:25 -0400 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2023-11-09 16:48:33 +0100 |
commit | c303df56d32faa47ef163726357ed3ee5d075b88 (patch) | |
tree | d00ee1101dd14b5c1bfbd712765a26d56b777845 /libpthread/nptl/sysdeps/nds32 | |
parent | 8166707a3350ce1fdaf669fb3836810727379342 (diff) |
libpthread/nptl: make default stack size configurable
Threads currently have 2-4 MiB stacks by default (depending on the
platform). This is fine on MMU platforms, where this stack space is not
actually allocated until it is used, but tends to waste a large amount
of memory on no-MMU platforms.
This patch adds a PTHREADS_STACK_DEFAULT_SIZE Kconfig option that allows
the user to override the default stack size at build time. This allows
the user to select a reasonable default stack size for the software that
runs on their system, and avoids the need to patch every package to add
calls to pthread_attr_setstacksize().
An alternative to this patch would be to change the hardcoded default
stack size on no-MMU platforms, but it is difficult to choose an
appropriate value because the minimum required stack depends on the
software in use. This would also be a breaking change.
Signed-off-by: Ben Wolsieffer <ben.wolsieffer@hefring.com>
Diffstat (limited to 'libpthread/nptl/sysdeps/nds32')
-rw-r--r-- | libpthread/nptl/sysdeps/nds32/pthreaddef.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/libpthread/nptl/sysdeps/nds32/pthreaddef.h b/libpthread/nptl/sysdeps/nds32/pthreaddef.h index c9d3f7781..0dca16c34 100644 --- a/libpthread/nptl/sysdeps/nds32/pthreaddef.h +++ b/libpthread/nptl/sysdeps/nds32/pthreaddef.h @@ -14,9 +14,6 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -/* Default stack size. */ -#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024) - /* Required stack pointer alignment at beginning. SSE requires 16 bytes. */ #define STACK_ALIGN 16 |