mirror of
https://github.com/servo/servo.git
synced 2025-06-17 12:54:28 +00:00
Implement MallocSizeOf properly for SmallBitVec.
This commit is contained in:
parent
280ccf685d
commit
9d057724eb
1 changed files with 10 additions and 4 deletions
|
@ -384,6 +384,16 @@ impl<T: MallocSizeOf> MallocConditionalSizeOf for Arc<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl MallocSizeOf for smallbitvec::SmallBitVec {
|
||||
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
|
||||
if let Some(ptr) = self.heap_ptr() {
|
||||
unsafe { ops.malloc_size_of(ptr) }
|
||||
} else {
|
||||
0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: MallocSizeOf, U> MallocSizeOf for TypedSize2D<T, U> {
|
||||
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
|
||||
let n = self.width.size_of(ops) + self.width.size_of(ops);
|
||||
|
@ -428,7 +438,3 @@ size_of_is_0!(Range<f32>, Range<f64>);
|
|||
|
||||
size_of_is_0!(app_units::Au);
|
||||
size_of_is_0!(cssparser::RGBA, cssparser::TokenSerializationType);
|
||||
|
||||
// XXX: once we upgrade smallbitvec to 1.0.4, use the new heap_ptr() method to
|
||||
// implement this properly
|
||||
size_of_is_0!(smallbitvec::SmallBitVec);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue