Skip to content

STW to Scan Stack

  • Stack growth operations
  • Stack scan special cases

When stack grows (2KB → 4KB), Go creates a new stack and copies old stack data over. Stack variable addresses change! So pointers on stack (pointing to heap, or pointing to other stack variables) must be corrected by Runtime. This explains why Stack Scan must be STW (or use extremely complex stack barriers).

Further Reading