fn approximate_size(&self) -> usize {
        use std::mem::size_of as size;
        // Estimate that there are about 16 instructions per state consuming
        // 64 = 16 * 4 bytes of space.
        let compiled =
            (self.cache.compiled.len() * (size::<StateKey>() + 64))
            + (self.cache.compiled.len() * size::<StatePtr>());
        let states =
            self.cache.states.len()
            * (size::<State>()
               + 64
               + (self.num_byte_classes() * size::<StatePtr>()));
        let start_states = self.cache.start_states.len() * size::<StatePtr>();
        self.prog.approximate_size() + compiled + states + start_states
    }
/// Approximate size returns the approximate heap space currently used by
/// the DFA. It is used to determine whether the DFA's state cache needs to
/// be wiped. Namely, it is possible that for certain regexes on certain
/// inputs, a new state could be created for every byte of input. (This is
/// bad for memory use, so we bound it with a cache.)
///
/// The approximation is guaranteed to be done in constant time (and
/// indeed, this requirement is why it's approximate).
Approximate size returns the approximate heap space currently used by
the DFA. It is used to determine whether the DFA's state cache needs to
be wiped. Namely, it is possible that for certain regexes on certain
inputs, a new state could be created for every byte of input. (This is
bad for memory use, so we bound it with a cache.)

The approximation is guaranteed to be done in constant time (and
indeed, this requirement is why it's approximate).
Approximate size returns the approximate heap space currently used by the DFA . It is used to determine whether the DFA ' s state cache needs to be wiped . Namely it is possible that for certain regexes on certain inputs a new state could be created for every byte of input . ( This is bad for memory use so we bound it with a cache . ) The approximation is guaranteed to be done in constant time ( and indeed this requirement is why it ' s approximate ) .
fn approximate_size(&self) -> usize {
        use std::mem::size_of as size;
        // Estimate that there are about 16 instructions per state consuming
        // 64 = 16 * 4 bytes of space.
        let compiled =
            (self.cache.compiled.len() * (size::<StateKey>() + 64))
            + (self.cache.compiled.len() * size::<StatePtr>());
        let states =
            self.cache.states.len()
            * (size::<State>()
               + 64
               + (self.num_byte_classes() * size::<StatePtr>()));
        let start_states = self.cache.start_states.len() * size::<StatePtr>();
        self.prog.approximate_size() + compiled + states + start_states
    }
fn approximate_size ( & self ) -> usize { use std :: mem :: size_of as size ; // Estimate that there are about 16 instructions per state consuming // 64 = 16 * 4 bytes of space. let compiled = ( self . cache . compiled . len ( ) * ( size :: < StateKey > ( ) + 64 ) ) + ( self . cache . compiled . len ( ) * size :: < StatePtr > ( ) ) ; let states = self . cache . states . len ( ) * ( size :: < State > ( ) + 64 + ( self . num_byte_classes ( ) * size :: < StatePtr > ( ) ) ) ; let start_states = self . cache . start_states . len ( ) * size :: < StatePtr > ( ) ; self . prog . approximate_size ( ) + compiled + states + start_states }
Approximate size returns the approximate heap space currently used by
the DFA.
Approximate size returns the approximate heap space currently used by the DFA .
&self
&self