Skip to content

Define the properties of Padding #882

Open
@Havvy

Description

@Havvy

We don't have a good explanation of the properties of padding. Currently we talk about it in two places:

  1. Type layout; It's pointed out that a type can have alignment padding that adds to the size.
  2. Added in clarify when reading uninititalized memory is allowed #852, it's pointed out that it can be set as uninitialized.

I think padding should probably be described in the type layout chapter.

My question though, other than being an unnameable psuedo-field that can theoretically have any value, does it have any other properties? E.g., can they be repurposed by enums to do niche optimizations (making it unsafe to set the value)? Other restrictions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-layoutArea: type layoutNew ContentMissing features or aspects of language not currently documented.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions