MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / AnalyzeSearchHelper

Method AnalyzeSearchHelper

extern/re2/re2/dfa.cc:1701–1724  ·  view source on GitHub ↗

Fills in info if needed. Returns true on success, false on failure.

Source from the content-addressed store, hash-verified

1699
1700// Fills in info if needed. Returns true on success, false on failure.
1701bool 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.
1727bool DFA::Search(const StringPiece& text,

Callers

nothing calls this directly

Calls 6

AddToQueueFunction · 0.85
start_unanchoredMethod · 0.80
loadMethod · 0.45
clearMethod · 0.45
startMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected