]> Cypherpunks repositories - gostls13.git/commit
runtime/cgo: let darwin pthread stacksize follow rlimit
authorYoulin Feng <fengyoulin@live.com>
Mon, 3 Oct 2022 13:15:12 +0000 (13:15 +0000)
committerCherry Mui <cherryyz@google.com>
Wed, 5 Oct 2022 14:48:48 +0000 (14:48 +0000)
commit7d3a5a501c9f30ff6db3016dbfffcb70dacb9f55
treecf659c84b59763c9d94cdecab1592a8ca42be3bc
parentc318f191e45e3496f8afe0a456337e9f76d7f7b4
runtime/cgo: let darwin pthread stacksize follow rlimit

On Mac OS X, the default stack size for non-main threads created by cgo is
fixed at 512KB and cannot be altered by setrlimit. This stack size is too
small for some recursive scenarios. We can solve this problem by explicitly
copying the stack size of the main thread when creating a new thread.

Change-Id: I400d5b2e929a1ee261502914a991e208759f64a8
GitHub-Last-Rev: b29c74599ea1cce4683d25e1ac8a70ffd9b86381
GitHub-Pull-Request: golang/go#53667
Reviewed-on: https://go-review.googlesource.com/c/go/+/415915
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: hopehook <hopehook@golangcn.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/runtime/cgo/gcc_darwin_amd64.c
src/runtime/cgo/gcc_darwin_arm64.c