Re: [go-nuts] How to safely convert a pointer to *unsafe.Pointer

2019-07-19 Thread Ian Lance Taylor
On Fri, Jul 19, 2019 at 4:33 PM wrote: > > I would like to make sure that the following line of Go is a defined behavior: > > addr := (*unsafe.Pointer)((unsafe.Pointer)()) > > I use it to perform atomic loads and stores to addr such as in this simple > example:

[go-nuts] How to safely convert a pointer to *unsafe.Pointer

2019-07-19 Thread julio
Hello, I would like to make sure that the following line of Go is a defined behavior: addr := (*unsafe.Pointer)((unsafe.Pointer)()) I use it to perform atomic loads and stores to addr such as in this simple example: https://play.golang.org/p/DpDrRvTYMG8 It allows me not to use atomic.Value