Skip to content

Packed&aligned structs? #73988

Closed
Closed
@leonardo-m

Description

@leonardo-m

Here they explain the need for repr(C) structs that are both aligned and packed:
https://immunant.com/blog/2020/06/kernel_modules/

Their solution:

#[repr(C, align(64))]
pub struct xregs_state(pub xregs_state_Inner);
#[repr(C, packed)]
pub struct xregs_state_Inner {
  // ...
}

Perhaps it's worth supporting this directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-layoutArea: Memory layout of typesC-feature-requestCategory: A feature request, i.e: not implemented / a PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions