From: Guus Sliepen Date: Mon, 12 Jul 2021 19:52:08 +0000 (+0200) Subject: Reduce the stack size of the background thread. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=92bae04187d9ecd7900b5a28154a2c046001a7f3;p=meshlink-tiny Reduce the stack size of the background thread. --- 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));