-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.O-windowsOperating system: WindowsOperating system: WindowsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
We reserve some stack space for handling stack overflow exceptions. Our exception handler just prints a stack overflow message along with the thread name. Currently we reserve ~20kb of stack:
This number is somewhat arbitrary and was chosen over a decade ago, pre-1.0, when Rust was a very different language. That said, we set the main thread to have a stack size of 1mb by default so 20kb is just a few percent of it. Still, sometimes every byte counts and I think it would be useful to have some kind of rationale for the number (e.g. is, say, 4kb not enough?).
Metadata
Metadata
Assignees
Labels
A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.O-windowsOperating system: WindowsOperating system: WindowsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.