Skip to content

refactor: simpler raw - #637

Merged
alejandro-vaz merged 6 commits into
servo:v2from
alejandro-vaz:simpler-raw
Sep 21, 2026
Merged

alejandro-vaz merged 6 commits into
servo:v2from
alejandro-vaz:simpler-raw

Conversation

@alejandro-vaz

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

Copy link
Copy Markdown
Collaborator

this PR moves the allocator from RawSmallVec to SmallVec, replacing RawSmallVec for the old RawSmallVecInner, and adding the allocator directly to IntoIter

it allows us to have a simpler internals API with a whole struct less, everything else stays the same

a safety guarantee to RawSmallVec::try_grow_raw was added, that the allocator must be the same the data is allocated in

closes #635

it also adds a Default for SmallVec<Type, N> implementation to make clippy stfu

key idea: RawSmallVec owns its data but not where it is (inline vs heap) nor where the heap is allocated (allocator)

@alejandro-vaz
alejandro-vaz requested a review from jdm September 20, 2026 12:47
@alejandro-vaz alejandro-vaz self-assigned this Sep 20, 2026
@bolshoytoster

Copy link
Copy Markdown
Contributor

Do we know of anyone actually using/planning to use the internals feature? This might be annoying to those people, if they exist.

Other than that, I do prefer self.raw.heap to self.raw.inner.heap.

@alejandro-vaz

Copy link
Copy Markdown
Collaborator Author

there are people interested in using the internals feature, you can look in issues at around #300 to #400, you'll probably find some

they were things like SmallVecDeque and LiteMap and some other things like that

it doesn't annoy anyone, brother the first version with this kind of internals was shipped yesterday hahahha

@alejandro-vaz

Copy link
Copy Markdown
Collaborator Author

indeed internals dates back to #348

Signed-off-by: Alejandro Vaz <alejandro.vaz.myt@gmail.com>
Signed-off-by: Alejandro Vaz <alejandro.vaz.myt@gmail.com>
@alejandro-vaz
alejandro-vaz added this pull request to the merge queue Sep 21, 2026
Merged via the queue into servo:v2 with commit 8ea4861 Sep 21, 2026
6 checks passed
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.

RawSmallVec simplification attempt prototype

3 participants