The //go:nosplit directive in Go prevents functions from performing stack overflow checks, making them faster but potentially dangerous. While nosplit functions avoid the ~2% performance overhead of stack growth checks and prevent preemption, they can cause linker errors, segfaults, and runtime livelocks if misused. The

10m read timeFrom mcyoung.xyz
Post cover image
Table of contents
Go Stack GrowthNosplit FunctionsBut It’s Harmless…?Other Side EffectsConclusion

Sort: