From d7052fbb6878906919eec415bbdc2de10edeb7b3 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 17 Jul 2017 10:08:59 -0400 Subject: [PATCH 1/2] Remove implementations for Arc and Vec It is better to have no measurements rather than blatantly incorrect ones. --- src/lib.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index a761b53..e0c56a4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -206,12 +206,6 @@ impl HeapSizeOf for (T1, T2, T3, T4, T5) } } -impl HeapSizeOf for Arc { - fn heap_size_of_children(&self) -> usize { - (**self).heap_size_of_children() - } -} - impl HeapSizeOf for RefCell { fn heap_size_of_children(&self) -> usize { self.borrow().heap_size_of_children() @@ -241,16 +235,6 @@ impl HeapSizeOf for VecDeque { } } -impl HeapSizeOf for Vec> { - fn heap_size_of_children(&self) -> usize { - // The fate of measuring Rc is still undecided, but we still want to measure - // the space used for storing them. - unsafe { - heap_size_of(self.as_ptr()) - } - } -} - impl HeapSizeOf for HashSet where T: Eq + Hash, S: BuildHasher { fn heap_size_of_children(&self) -> usize { From 70a74bf31170a087ff3faf12b252e49dd5b59526 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 17 Jul 2017 10:32:26 -0400 Subject: [PATCH 2/2] Remove unused imports. --- src/lib.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e0c56a4..7dbb2c2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,9 +14,7 @@ use std::marker::PhantomData; use std::mem::{size_of, align_of}; use std::net::{Ipv4Addr, Ipv6Addr}; use std::os::raw::c_void; -use std::sync::Arc; use std::sync::atomic::{AtomicBool, AtomicIsize, AtomicUsize}; -use std::rc::Rc; /// Get the size of a heap block. ///