On Thu, Sep 27, 2018 at 11:14 PM, Peter Mogensen <a...@one.com> wrote:
>
> Are you saying this statement from the Go spec is subject to change:
> "Pointer values are comparable. Two pointer values are equal if they
> point to the same variable or if both have value nil. Pointers to
> distinct zero-size variables may or may not be equal. "

That statement is not subject to change.  Note that that statement
does not say that if p1 and p2 are pointer values, and that p1 == p2,
that uintptr(unsafe.Pointer(p1)) == uintptr(unsafe.Pointer(p2)).  You
must not take intuitions from computer hardware into a managed memory
language like Go.  The rules about the safe use of pointers converted
to uintptr are written down at https://golang.org/pkg/unsafe/#Pointer
.  Doing anything not explicitly permitted there is unsafe, where
unsafe means that your program may suffer from arbitrary memory
corruption and may crash at any time.

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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to