Fills in info if needed. Returns true on success, false on failure.
| 1699 | |
| 1700 | // Fills in info if needed. Returns true on success, false on failure. |
| 1701 | bool DFA::AnalyzeSearchHelper(SearchParams* params, StartInfo* info, |
| 1702 | uint32_t flags) { |
| 1703 | // Quick check. |
| 1704 | State* start = info->start.load(std::memory_order_acquire); |
| 1705 | if (start != NULL) |
| 1706 | return true; |
| 1707 | |
| 1708 | MutexLock l(&mutex_); |
| 1709 | start = info->start.load(std::memory_order_relaxed); |
| 1710 | if (start != NULL) |
| 1711 | return true; |
| 1712 | |
| 1713 | q0_->clear(); |
| 1714 | AddToQueue(q0_, |
| 1715 | params->anchored ? prog_->start() : prog_->start_unanchored(), |
| 1716 | flags); |
| 1717 | start = WorkqToCachedState(q0_, NULL, flags); |
| 1718 | if (start == NULL) |
| 1719 | return false; |
| 1720 | |
| 1721 | // Synchronize with "quick check" above. |
| 1722 | info->start.store(start, std::memory_order_release); |
| 1723 | return true; |
| 1724 | } |
| 1725 | |
| 1726 | // The actual DFA search: calls AnalyzeSearch and then FastSearchLoop. |
| 1727 | bool DFA::Search(const StringPiece& text, |
nothing calls this directly
no test coverage detected