From 92bae04187d9ecd7900b5a28154a2c046001a7f3 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 12 Jul 2021 21:52:08 +0200 Subject: [PATCH] Reduce the stack size of the background thread. --- src/meshlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/meshlink.c b/src/meshlink.c index aadbaf3..6b6e4b0 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -1158,10 +1158,10 @@ bool meshlink_start(meshlink_handle_t *mesh) { event_loop_start(&mesh->loop); - // Ensure we have a decent amount of stack space. Musl's default of 80 kB is too small. + // Ensure we have a small but sufficient amount of stack space. pthread_attr_t attr; pthread_attr_init(&attr); - pthread_attr_setstacksize(&attr, 1024 * 1024); + pthread_attr_setstacksize(&attr, 16 * 1024); if(pthread_create(&mesh->thread, &attr, meshlink_main_loop, mesh) != 0) { logger(mesh, MESHLINK_ERROR, "Could not start thread: %s\n", strerror(errno)); -- 2.39.5