MCPcopy Create free account
hub / github.com/davidblewett/rure-python / approximate_size

Method approximate_size

regex/src/dfa.rs:1606–1608  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 1

cached_stateMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected