Commit 7ca339b
committed
fixup??? grep: make PCRE2 aware of custom allocator
It is _not_ nedmalloc-specific! Never was, never will. As soon as you
use e.g. the LD_PRELOAD trick to use jemalloc, the very same issues will
arise as I reported earlier: a block that was allocated via PCRE2 wants
to be `free()`d via the custom allocator, which will cause serious
issues unless we make sure that PCRE2 uses the same allocator as Git.
Besides, the location where `pcre2_global_context` was initialized is
completely wrong. That code path was not even close to being hit in
t7816.48, however, that test case really needs that context.
Let's stop trying to be smart (and failing at it), and instead just
initialize the global context in `grep_init()` and be done with these
problems once and for all. The chase stopped being fun a month ago.
Signed-off-by: Johannes Schindelin <[email protected]>1 parent ea99c3e commit 7ca339b
1 file changed
+6
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | | - | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
| |||
176 | 174 | | |
177 | 175 | | |
178 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
179 | 183 | | |
180 | 184 | | |
181 | 185 | | |
| |||
343 | 347 | | |
344 | 348 | | |
345 | 349 | | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | 350 | | |
352 | 351 | | |
353 | 352 | | |
| |||
0 commit comments