On Wed, Jun 7, 2023 at 5:13 AM 'Mikhail Gritsenko' via golang-nuts <golang-nuts@googlegroups.com> wrote: > > Why does sudog struct for elem field for the second node in sendq of a chan > hold unsafe.Pointer BUT the first node of the sendq holds actual value? Is it > somehow related with sendDirect or this is just an address of a value that > allocated on a stack of the sending goroutine?
Sorry, I'm not sure I understand the question. The sendq is just a linked list of sudog structs. I'm not sure what you mean by the first node. The elem field of a sudog is a pointer to the value being sent on a channel (or a pointer to a place to put a value received from a channel). That field is in the sudog so that the other end of the channel can copy the value when performing a channel operation. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVTxFEJJN95sxWgoRS96W7fj2gV1KbmJhGNJAEb4qyZNg%40mail.gmail.com.