Skip to content

Size of the DSTORAGE_REQUEST_OPTIONS #22

@hasenbanck

Description

@hasenbanck

While porting the DirectStorage API to Rust, we found the following curriosity and would like to as if it's working as designed:

The DSTORAGE_REQUEST_OPTIONS is defines as a bitfield and it seems that the design goal was that all fields are packed into a single unsigned 64 bit integer field.

But the current implementation is not of byte size 8, but of size 16, since MSVC is only packing fields with the same type into the same backing field. Since DSTORAGE_COMPRESSION_FORMAT is an UINT8 and not an UINT64 like the other fields, it will be stored by MSVC into it's own backing field. Allignment and padding then will grow the size of DSTORAGE_REQUEST_SOURCE_TYPE to 16 bytes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions