Skip to content

refactor: new rawsmallvec representation - #590

Draft
alejandro-vaz wants to merge 11 commits into
servo:v2from
alejandro-vaz:newraw
Draft

refactor: new rawsmallvec representation#590
alejandro-vaz wants to merge 11 commits into
servo:v2from
alejandro-vaz:newraw

Conversation

@alejandro-vaz

@alejandro-vaz alejandro-vaz commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

this PR is a draft

closes #583

closes #441

@alejandro-vaz alejandro-vaz added this to the v2-alpha.14 milestone Sep 6, 2026
@alejandro-vaz alejandro-vaz self-assigned this Sep 6, 2026
@alejandro-vaz alejandro-vaz changed the title Newraw refactor: new rawsmallvec representation Sep 6, 2026
@alejandro-vaz

Copy link
Copy Markdown
Collaborator Author

will solve it tomorrow

@fereidani

Copy link
Copy Markdown
Contributor

Hey Good Idea but this 5 lines kept repeating in the changes:

          if on_heap {
              self.raw.as_heap()
          } else {
              self.raw.as_inline()
          }

Why not use a refactored/compatible as_ptr(on_heap) and as_mut_ptr(on_heap) instead?

@alejandro-vaz

alejandro-vaz commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

yeah I haven't done that yet, I wanted to first do it that way and check it works

doing so that way erases the length of the array on type data on the inline variant so I was pretty reluctant to do so at first

@alejandro-vaz

Copy link
Copy Markdown
Collaborator Author

great... I killed something and I don't know why

@alejandro-vaz

Copy link
Copy Markdown
Collaborator Author

I need a few more days for this

@fereidani this is a bombshell to how we represent the rawsmallvec, would be grateful I you could provide integration support to make sure that this lands correctly

just fixed a bunch of test errors because of some mistake I made whilst remaking try_grow_raw

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

switch RawSmallVec.inline to ManuallyDrop<[MaybeUninit<T>; N]> change RawSmallVec heap to NonNull<[MaybeUninit<T>]>

2 participants