virtio-devices: Use SmallVec for descriptor chains

Rather than instantiating a vector for parsing the descriptor chain in
advance instead use a SmallVec bounded by the expected length of the
descriptor chain. This removes vector allocations from those paths.

As smallvec was already a block dependency move it to a workspace
dependency and use it from there.

Fixes: #5079

Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
Rob Bradford
2026-07-07 09:14:23 +01:00
committed by Wei Liu
parent ba3cfd7d9d
commit ad3dbcd130
7 changed files with 12 additions and 6 deletions

View File

@@ -20,7 +20,7 @@ libc = { workspace = true }
log = { workspace = true }
remain = "0.2.15"
serde = { workspace = true, features = ["derive"] }
smallvec = "1.15.1"
smallvec = { workspace = true }
thiserror = { workspace = true }
uuid = { workspace = true, features = ["v4"] }
virtio-bindings = { workspace = true }