pub fn mem_used(&self) -> usize {
        let mut tot = std::mem::size_of::<usize>();
        unsafe {
            if self.0.tiny == 0 {
                // nothing
            } else if self.0.tiny & 3 == 1 {
                // nothing
            } else if self.0.tiny & 3 == 0 {
                let s = &*self.0.ptr;
                // assert_eq!((s.cap & 31).count_ones(), 1);
                let cap = 1 << (s.cap & 31);
                tot += std::mem::size_of::<S>() - 4 + cap*8;
                // println!("mem_used for table {}", tot);
            } else {
                let ptr = (self.0.tiny & !3) as *mut S;
                let s = &*ptr;
                tot += std::mem::size_of::<S>() - 4 + s.cap as usize*4;
                // println!("mem_used for dense {}", tot);
            }
        }
        tot
    }
/// The total memory used by the set (including stack)
The total memory used by the set (including stack)
The total memory used by the set ( including stack )
pub fn mem_used(&self) -> usize {
        let mut tot = std::mem::size_of::<usize>();
        unsafe {
            if self.0.tiny == 0 {
                // nothing
            } else if self.0.tiny & 3 == 1 {
                // nothing
            } else if self.0.tiny & 3 == 0 {
                let s = &*self.0.ptr;
                // assert_eq!((s.cap & 31).count_ones(), 1);
                let cap = 1 << (s.cap & 31);
                tot += std::mem::size_of::<S>() - 4 + cap*8;
                // println!("mem_used for table {}", tot);
            } else {
                let ptr = (self.0.tiny & !3) as *mut S;
                let s = &*ptr;
                tot += std::mem::size_of::<S>() - 4 + s.cap as usize*4;
                // println!("mem_used for dense {}", tot);
            }
        }
        tot
    }
pub fn mem_used ( & self ) -> usize { let mut tot = std :: mem :: size_of :: < usize > ( ) ; unsafe { if self . 0 . tiny == 0 { // nothing } else if self . 0 . tiny & 3 == 1 { // nothing } else if self . 0 . tiny & 3 == 0 { let s = & * self . 0 . ptr ; // assert_eq!((s.cap & 31).count_ones(), 1); let cap = 1 << ( s . cap & 31 ) ; tot += std :: mem :: size_of :: < S > ( ) - 4 + cap * 8 ; // println!("mem_used for table {}", tot); } else { let ptr = ( self . 0 . tiny & ! 3 ) as * mut S ; let s = & * ptr ; tot += std :: mem :: size_of :: < S > ( ) - 4 + s . cap as usize * 4 ; // println!("mem_used for dense {}", tot); } } tot }
The total memory used by the set (including stack)
The total memory used by the set ( including stack )
&self
&self