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.)
(&self)
| 1604 | /// inputs, a new state could be created for every byte of input. (This is |
| 1605 | /// bad for memory use, so we bound it with a cache.) |
| 1606 | fn approximate_size(&self) -> usize { |
| 1607 | self.cache.size + self.prog.approximate_size() |
| 1608 | } |
| 1609 | } |
| 1610 | |
| 1611 | /// An abstraction for representing a map of states. The map supports two |