Re: [go-nuts] A confusion on the cgo document.

2019-10-02 Thread T L
Got it. Thanks, Ian. On Mon, Sep 30, 2019 at 9:10 PM Ian Lance Taylor wrote: > On Mon, Sep 30, 2019 at 1:01 AM T L wrote: > > > > https://golang.org/cmd/cgo/#hdr-Passing_pointers > > > > When passing a pointer to a field in a struct, the Go memory in question > is the memory occupied by the fie

Re: [go-nuts] A confusion on the cgo document.

2019-09-30 Thread Ian Lance Taylor
On Mon, Sep 30, 2019 at 1:01 AM T L wrote: > > https://golang.org/cmd/cgo/#hdr-Passing_pointers > > When passing a pointer to a field in a struct, the Go memory in question is > the memory occupied by the field, not the entire struct. When passing a > pointer to an element in an array or slice,

[go-nuts] A confusion on the cgo document.

2019-09-30 Thread T L
https://golang.org/cmd/cgo/#hdr-Passing_pointers When passing a pointer to a field in a struct, the Go memory in question is the memory occupied by the field, not the entire struct. When passing a pointer to an element in an array or slice, the Go memory in question is the entire array or the e