1
0
Fork 0

Stack size at least 8MB on libmusl. (#4528)

This commit is contained in:
Max Neunhöffer 2018-02-09 15:02:58 +01:00 committed by GitHub
parent 9ffbc908f3
commit 3352be3166
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -140,6 +140,20 @@ ArangoGlobalContext::ArangoGlobalContext(int argc, char* argv[],
TRI_GetInstallRoot(TRI_LocateBinaryPath(argv[0]), InstallDirectory)),
_ret(EXIT_FAILURE),
_useEventLog(true) {
#ifndef _WIN32
#ifndef __APPLE__
#ifndef __GLIBC__
// Increase default stack size for libmusl:
pthread_attr_t a;
memset(&a, 0, sizeof(pthread_attr_t));
pthread_attr_setstacksize(&a, 8*1024*1024); // 8MB as in glibc
pthread_attr_setguardsize(&a, 4096); // one page
pthread_setattr_default_np(&a);
#endif
#endif
#endif
// allow failing memory allocations for the global context thread (i.e. main program thread)
TRI_AllowMemoryFailures();