
How Stacks are Handled in Go
9/15/2014
This post details the evolution of Go's stack management from segmented stacks to stack copying. It explains the mechanics of segmented stacks, including stack splits and the 'lessstack' function, and highlights the 'hot split' problem. It then introduces stack copying, explaining how it addresses the shrinking overhead by doubling stack size and copying data, and discusses the reliance on garbage collection information for pointer updates. The post also touches upon the challenges of rewriting the Go runtime in Go to enable stack copying for all parts of the system and briefly discusses the limitations of virtual memory for stack allocation.