Skip to content

Commit

Permalink
increase default pthread stack to 8MiB on 64-bit
Browse files Browse the repository at this point in the history
Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
  • Loading branch information
thestinger committed Jun 7, 2021
1 parent a042b5a commit 9ec639d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libc/bionic/pthread_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,11 @@ __LIBC_HIDDEN__ void pthread_key_clean_all(void);
// stack overflows, we subtracted the same amount we were using there
// from the default thread stack size. This should keep memory usage
// roughly constant.
#ifdef __LP64__
#define PTHREAD_STACK_SIZE_DEFAULT ((8 * 1024 * 1024) - SIGNAL_STACK_SIZE_WITHOUT_GUARD)
#else
#define PTHREAD_STACK_SIZE_DEFAULT ((1 * 1024 * 1024) - SIGNAL_STACK_SIZE_WITHOUT_GUARD)
#endif

// Leave room for a guard page in the internally created signal stacks.
#define SIGNAL_STACK_SIZE (SIGNAL_STACK_SIZE_WITHOUT_GUARD + PTHREAD_GUARD_SIZE)
Expand Down

0 comments on commit 9ec639d

Please sign in to comment.