To Jan & Ohir, thanks for information.

Do you run my code example in GO plagground?  The pointer size of `a` is 4 
bytes, it shows go playground use 32bit go. As my test, the go playground 
environment is:


GOOS: nacl 
GOARCH: amd64p32

the Machine is amd64, but run 32bit GO.


My Machine is amd64 too, I download this version of GO: 
https://storage.googleapis.com/golang/go1.8.1.windows-386.zip


I think my envvironment is similiar to GO playground.


Maybe my question should be: Keep the pointer size is 4 bytes, Which version of 
GO binary I shoud use to make uint64 aligns to 8 bytes?


Best Regards,

xjdrew



On Friday, May 19, 2017 at 9:07:58 PM UTC+8, ohir wrote:
>
> Dnia 2017-05-19, o godz. 04:28:53 
> xjdrew <xj....@gmail.com <javascript:>> napisaƂ(a): 
>
> > uint64 should aligin in 8 bytes, why it aligns in 4 bytes in 
> > go1.8.1.linux-386? 
>
> uint64 member IS 8 bytes wide. It is aligned to the machine word boundary 
> which is 4B (32/8) for 32bit architecture and 8B for 64b one (64/8). 
>
> > Could anyone tell me how I can get the same result with go playground? 
> You can not. Go playground uses 64b platform. 
>
> -- 
> Wojciech S. Czarnecki 
>        ^oo^ OHIR-RIPE 
>

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