On 29 March 2017 at 04:44, T L <tapir....@gmail.com> wrote: > > > On Thursday, February 2, 2017 at 12:03:59 AM UTC+8, T L wrote: >> >> the sync/atomic docs, https://golang.org/pkg/sync/atomic/, says in the >> end of the docs >> >> >> On x86-32, the 64-bit functions use instructions unavailable before the >>> Pentium MMX. >>> >> On non-Linux ARM, the 64-bit functions use instructions unavailable >>> before the ARMv6k core. >>> >>> On both ARM and x86-32, it is the caller's responsibility to arrange for >>> 64-bit alignment of 64-bit words accessed atomically. >>> >> > Does the "ARM" here include ARMv8 (64-bit)? >
On a 64 bit platform, 64-bit integers are naturally aligned on 64 bits so you shouldn't have to make any extra effort to arrange for it to happen. Cheers, mwh > The first word in a global variable or in an allocated struct or slice can >>> be relied upon to be 64-bit aligned. >>> >> >> The last line says the first word in a global variable or in an allocated >> struct or slice is 64-bit aligned for sure. >> But what does an allocated struct or slice means? A struct or slice >> allocated on heap, not stack? >> > -- > 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. > -- 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.