Re: [go-nuts] different way to malloc memory when creating channel

2018-10-21 Thread Fei Ding
Thanks for the clarification. On Mon, Oct 22, 2018 at 13:13 Ian Lance Taylor wrote: > On Sun, Oct 21, 2018 at 8:34 PM, Fei Ding wrote: > > > > I am studying golang source code, literally `go/src/runtime/chan.go`, the > > question is in function `makechan`, when it comes to malloc memory for > >

Re: [go-nuts] different way to malloc memory when creating channel

2018-10-21 Thread Ian Lance Taylor
On Sun, Oct 21, 2018 at 8:34 PM, Fei Ding wrote: > > I am studying golang source code, literally `go/src/runtime/chan.go`, the > question is in function `makechan`, when it comes to malloc memory for > channel with/without pointers, you guys did it as: > > > case elem.kind&kindNoPointers != 0: >

[go-nuts] different way to malloc memory when creating channel

2018-10-21 Thread Fei Ding
Hi I am studying golang source code, literally `go/src/runtime/chan.go`, the question is in function `makechan`, when it comes to malloc memory for channel with/without pointers, you guys did it as: case elem.kind&kindNoPointers != 0: // Elements do not contain pointers. // Allocate hchan and