Skip to content

simplify the TaggedLen / set_len / capacity ... model #451

Description

@alejandro-vaz

the current length/capacity model is becoming hard to maintain and understand leading to strange miri provenance bugs #406

what we need conceptually is:

TaggedLen: Copy -> [onheap:1][length:63]
- default() -> Self
- new(bool, usize) -> Self
- length(self) -> usize
- onheap(self) -> bool
- get(self) -> (bool, usize)
- resize(&mut self, usize) -> ()
- relocate(&mut self, bool) -> ()
- update(&mut self, bool, usize) -> ()

and no additional methods like set_len on SmallVec

currently set_len depends on capacity its downstream methods, so this is not a simple refactor

the sketch above is just a concept

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedNo clear candidate to implement itp-highhigh priorityr-refactorrelated to refactoring

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions