From fd437cb61fefdc4abf44813a171c9cf18df695b3 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meshlink.c b/src/meshlink.c index aadbaf3..7c37c7b 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -1161,7 +1161,7 @@ bool meshlink_start(meshlink_handle_t *mesh) { // Ensure we have a decent amount of stack space. Musl's default of 80 kB is too small. 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