| 157 | } |
| 158 | |
| 159 | NFA::Thread* NFA::AllocThread() { |
| 160 | Thread* t = freelist_; |
| 161 | if (t != NULL) { |
| 162 | freelist_ = t->next; |
| 163 | t->ref = 1; |
| 164 | // We don't need to touch t->capture because |
| 165 | // the caller will immediately overwrite it. |
| 166 | return t; |
| 167 | } |
| 168 | arena_.emplace_back(); |
| 169 | t = &arena_.back(); |
| 170 | t->ref = 1; |
| 171 | t->capture = new const char*[ncapture_]; |
| 172 | return t; |
| 173 | } |
| 174 | |
| 175 | NFA::Thread* NFA::Incref(Thread* t) { |
| 176 | DCHECK(t != NULL); |
nothing calls this directly
no test coverage detected