mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
Slightly increase thread stack size for safety (primary Alpine related) possibly GitHub #443
This commit is contained in:
parent
2ceb162df0
commit
471108f2e4
2 changed files with 7 additions and 1 deletions
|
@ -419,6 +419,11 @@
|
||||||
#define ZT_UDP_DESIRED_BUF_SIZE 131072
|
#define ZT_UDP_DESIRED_BUF_SIZE 131072
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Desired / recommended min stack size for threads (used on some platforms to reset thread stack size)
|
||||||
|
*/
|
||||||
|
#define ZT_THREAD_MIN_STACK_SIZE 1048576
|
||||||
|
|
||||||
/* Ethernet frame types that might be relevant to us */
|
/* Ethernet frame types that might be relevant to us */
|
||||||
#define ZT_ETHERTYPE_IPV4 0x0800
|
#define ZT_ETHERTYPE_IPV4 0x0800
|
||||||
#define ZT_ETHERTYPE_ARP 0x0806
|
#define ZT_ETHERTYPE_ARP 0x0806
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include <WinSock2.h>
|
#include <WinSock2.h>
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "../node/Mutex.hpp"
|
#include "../node/Mutex.hpp"
|
||||||
|
|
||||||
namespace ZeroTier {
|
namespace ZeroTier {
|
||||||
|
@ -128,7 +129,7 @@ public:
|
||||||
pthread_attr_init(&_tattr);
|
pthread_attr_init(&_tattr);
|
||||||
// This corrects for systems with abnormally small defaults (musl) and also
|
// This corrects for systems with abnormally small defaults (musl) and also
|
||||||
// shrinks the stack on systems with large defaults to save a bit of memory.
|
// shrinks the stack on systems with large defaults to save a bit of memory.
|
||||||
pthread_attr_setstacksize(&_tattr,524288);
|
pthread_attr_setstacksize(&_tattr,ZT_THREAD_MIN_STACK_SIZE);
|
||||||
_started = false;
|
_started = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue