package main

import (
    "unsafe"
)

func alignment(p *int64) uintptr {
    return unsafe.Alignof(*p)
    // compiler doesn't know if *p is a field or a variable.
    // so compiler will treat *p as a variable, I think.
}

type T struct {
    x int64
}

func main() {
    var t T
    println( alignment(&t.x) )       // case 1
    println( unsafe.Alignof(*&t.x) ) // case 2
    println( unsafe.Alignof(t.x) ) // case 3
    // Is the case 2 equivalent to case 1 or case 3?
}

-- 
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