mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Clean up unused dependencies / features and centralize more feature selection into root Cargo.toml
(#37720)
- Make feature flag of smallvec global. - Removed unused dependency of thinvec. - Removed unused flag of hyper-util. Reduces the binary size by an astonishing 3.352k. Testing: Compilation 'tests' this change. Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
parent
c8132137cd
commit
4d35b69ffe
6 changed files with 4 additions and 32 deletions
|
@ -45,7 +45,7 @@ serde = { workspace = true }
|
|||
servo_arc = { workspace = true }
|
||||
servo_config = { path = "../config" }
|
||||
servo_url = { path = "../url" }
|
||||
smallvec = { workspace = true, features = ["union"] }
|
||||
smallvec = { workspace = true }
|
||||
stylo = { workspace = true }
|
||||
stylo_atoms = { workspace = true }
|
||||
tracing = { workspace = true, optional = true }
|
||||
|
|
|
@ -32,7 +32,6 @@ stylo = { workspace = true }
|
|||
stylo_dom = { workspace = true }
|
||||
stylo_malloc_size_of = { workspace = true }
|
||||
taffy = { workspace = true }
|
||||
thin-vec = { workspace = true }
|
||||
tokio = { workspace = true, features = ["sync"] }
|
||||
unicode-bidi = { workspace = true }
|
||||
unicode-script = { workspace = true }
|
||||
|
|
|
@ -352,31 +352,6 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<T> MallocShallowSizeOf for thin_vec::ThinVec<T> {
|
||||
fn shallow_size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
|
||||
if self.capacity() == 0 {
|
||||
// If it's the singleton we might not be a heap pointer.
|
||||
return 0;
|
||||
}
|
||||
|
||||
assert_eq!(
|
||||
std::mem::size_of::<Self>(),
|
||||
std::mem::size_of::<*const ()>()
|
||||
);
|
||||
unsafe { ops.malloc_size_of(*(self as *const Self as *const *const ())) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: MallocSizeOf> MallocSizeOf for thin_vec::ThinVec<T> {
|
||||
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
|
||||
let mut n = self.shallow_size_of(ops);
|
||||
for elem in self.iter() {
|
||||
n += elem.size_of(ops);
|
||||
}
|
||||
n
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: MallocSizeOf> MallocSizeOf for BinaryHeap<T> {
|
||||
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
|
||||
self.iter().map(|element| element.size_of(ops)).sum()
|
||||
|
|
|
@ -114,7 +114,7 @@ servo_config = { path = "../config" }
|
|||
servo_geometry = { path = "../geometry" }
|
||||
servo_rand = { path = "../rand" }
|
||||
servo_url = { path = "../url" }
|
||||
smallvec = { workspace = true, features = ["union"] }
|
||||
smallvec = { workspace = true }
|
||||
strum = { workspace = true }
|
||||
strum_macros = { workspace = true }
|
||||
stylo = { workspace = true }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue