Re: [go-nuts] How GC trace stack objects

2021-11-04 Thread Ge
Thank you Ian for the great answer. 在2021年11月4日星期四 UTC+8 上午7:21:57 写道: > On Wed, Nov 3, 2021 at 8:56 AM Ge wrote: > > > > Hi, recently I was trying to figure out how GC marks stack objects and > found > > some places of the implementation detail over my head. > > > > source: > > ``` > > package

Re: [go-nuts] How GC trace stack objects

2021-11-03 Thread Ian Lance Taylor
On Wed, Nov 3, 2021 at 8:56 AM Ge wrote: > > Hi, recently I was trying to figure out how GC marks stack objects and found > some places of the implementation detail over my head. > > source: > ``` > package main > > import "runtime" > > func main() { > x := make([]byte, 256*1024*1024) > ru

[go-nuts] How GC trace stack objects

2021-11-03 Thread Ge
Hi, recently I was trying to figure out how GC marks stack objects and found some places of the implementation detail over my head. source: ``` package main import "runtime" func main() { x := make([]byte, 256*1024*1024) runtime.GC() ←t1 x[0] = 2 runtime.GC()←t2