Skip to content

documentation: Go internal abi specification document alignment confusion #53223

Closed as not planned
@hawkinsw

Description

@hawkinsw

Hello everyone!

I hope that this is the right place to raise this issue:

I have read through the "Go internal ABI specification" (src/cmd/compile/internal-abi.md) and have studied the excellent, thorough discussion of the definition of the alignment of sequences (of which a struct is a special case) and the alignment of built-in types.

I am curious, however, how that squares with the following statement

On ARM, 386, and 32-bit MIPS, it is the caller's responsibility to arrange for 64-bit alignment of 64-bit words accessed atomically. The first word in a variable or in an allocated struct, array, or slice can be relied upon to be 64-bit aligned.

from https://pkg.go.dev/sync/atomic#pkg-note-BUG.

Nothing in the "Go internal ABI specification" seems to indicate that there is a special case for these architectures. I was just wondering if this is is because the representation made by https://pkg.go.dev/sync/atomic#pkg-note-BUG concerns the "public" ABI and would supersede the definitions/algorithms in the internal ABI in this case?

Or, is it simply something that is just out of date with a (admittedly internal) piece of documentation. If it is, I would be glad to submit a patch for the "Go internal ABI specification" document to bring it up to date.

That document is such a helpful, interesting read for so many reasons and one of the main reasons why I really enjoy working with this language!

Thanks for everything!
Will

cc @danscales

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions