On Tuesday, March 21, 2017 at 1:29:39 AM UTC+8, peterGo wrote: > > T L, > > For example: https://play.golang.org/p/BSwB8jQwBY > Peter >
Yes, there are some bytes padded, but for the struct S. The size of the struct S is 16 bytes, so there is no paddings when it is used as element of an array. So you mean the answer for the following question is yes, right? "if the first element in an array is 64bit aligned and the size of array elements is 8N bytes, is it for sure that all elements in the array are 64bit aligned?" > > On Monday, March 20, 2017 at 1:24:46 PM UTC-4, peterGo wrote: >> >> s/strcts/structs/ >> >> On Monday, March 20, 2017 at 1:24:06 PM UTC-4, peterGo wrote: >>> >>> TL, >>> >>> https://golang.org/ref/spec#Size_and_alignment_guarantees >>> >>> For eample, some strcts. >>> >>> Peter >>> >>> On Monday, March 20, 2017 at 11:23:02 AM UTC-4, T L wrote: >>>> >>>> Or if the first element in an array is 64bit aligned and the size of >>>> array elements is 8N bytes, >>>> is it for sure that all elements in the array are 64bit aligned? >>>> >>> -- 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.