MCPcopy Index your code
hub / github.com/git/git / pcre2_jit_functional

Function pcre2_jit_functional

grep.c:270–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270static int pcre2_jit_functional(void)
271{
272 static int jit_working = -1;
273 pcre2_code *code;
274 size_t off;
275 int err;
276
277 if (jit_working != -1)
278 return jit_working;
279
280 /*
281 * Try to JIT compile a simple pattern to probe if the JIT is
282 * working in general. It might fail for systems where creating
283 * memory mappings for runtime code generation is restricted.
284 */
285 code = pcre2_compile((PCRE2_SPTR)".", 1, 0, &err, &off, NULL);
286 if (!code)
287 return 0;
288
289 jit_working = pcre2_jit_compile(code, PCRE2_JIT_COMPLETE) == 0;
290 pcre2_code_free(code);
291
292 return jit_working;
293}
294
295static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt)
296{

Callers 1

compile_pcre2_patternFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected