Skip to content

Avoid using naked memory accesses in the mock queues #123

@slp

Description

@slp

Operations on the mock queues are usually done through the load and store methods of Ref. While this was initially convenient, it makes harder to implement checks or conversions (such as endianess transformations) for certain fields. It's also less readable, as the developer needs to identify what's being read or written by its location in the ring.

I see two options to improve this:

  1. Avoid returning Ref and ArrayRef from SplitQueueRing, implementing instead methods with concrete types for each data field being accessed.
  2. Avoid the use of primitive types in tests, always wrapping them in structs with descriptive names and accessor methods.

Option (1) sounds more reasonable to me, but I don't have an strong opinion about them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions