mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Remove some use
statements in malloc_size_of.
This file potentially uses multiple implementations of types like `Arc`, so explicit qualification makes things clearer.
This commit is contained in:
parent
e030c0d96a
commit
009150696f
1 changed files with 7 additions and 9 deletions
|
@ -64,8 +64,6 @@ extern crate servo_arc;
|
|||
extern crate smallbitvec;
|
||||
extern crate smallvec;
|
||||
|
||||
use servo_arc::Arc;
|
||||
use smallvec::{Array, SmallVec};
|
||||
use std::hash::{BuildHasher, Hash};
|
||||
use std::ops::Range;
|
||||
use std::os::raw::c_void;
|
||||
|
@ -244,7 +242,7 @@ impl<T: MallocSizeOf> MallocSizeOf for Vec<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<A: Array> MallocShallowSizeOf for SmallVec<A> {
|
||||
impl<A: smallvec::Array> MallocShallowSizeOf for smallvec::SmallVec<A> {
|
||||
fn shallow_size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
|
||||
if self.spilled() {
|
||||
unsafe { ops.malloc_size_of(self.as_ptr()) }
|
||||
|
@ -254,8 +252,8 @@ impl<A: Array> MallocShallowSizeOf for SmallVec<A> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<A> MallocSizeOf for SmallVec<A>
|
||||
where A: Array,
|
||||
impl<A> MallocSizeOf for smallvec::SmallVec<A>
|
||||
where A: smallvec::Array,
|
||||
A::Item: MallocSizeOf
|
||||
{
|
||||
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
|
||||
|
@ -348,19 +346,19 @@ impl<K, V, S> MallocSizeOf for hashglobe::hash_map::HashMap<K, V, S>
|
|||
//impl<T> !MallocSizeOf for Arc<T> { }
|
||||
//impl<T> !MallocShallowSizeOf for Arc<T> { }
|
||||
|
||||
impl<T> MallocUnconditionalShallowSizeOf for Arc<T> {
|
||||
impl<T> MallocUnconditionalShallowSizeOf for servo_arc::Arc<T> {
|
||||
fn unconditional_shallow_size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
|
||||
unsafe { ops.malloc_size_of(self.heap_ptr()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: MallocSizeOf> MallocUnconditionalSizeOf for Arc<T> {
|
||||
impl<T: MallocSizeOf> MallocUnconditionalSizeOf for servo_arc::Arc<T> {
|
||||
fn unconditional_size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
|
||||
self.unconditional_shallow_size_of(ops) + (**self).size_of(ops)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> MallocConditionalShallowSizeOf for Arc<T> {
|
||||
impl<T> MallocConditionalShallowSizeOf for servo_arc::Arc<T> {
|
||||
fn conditional_shallow_size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
|
||||
if ops.have_seen_ptr(self.heap_ptr()) {
|
||||
0
|
||||
|
@ -370,7 +368,7 @@ impl<T> MallocConditionalShallowSizeOf for Arc<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: MallocSizeOf> MallocConditionalSizeOf for Arc<T> {
|
||||
impl<T: MallocSizeOf> MallocConditionalSizeOf for servo_arc::Arc<T> {
|
||||
fn conditional_size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
|
||||
if ops.have_seen_ptr(self.heap_ptr()) {
|
||||
0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue