Re: [PATCH v2 2/3] grep: make PCRE2 aware of custom allocator
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 18, 2019, 01:38 UTC
- Message-ID
- <xmqqsgnq6des.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <191d3a2280232ff98964fd42bfe0bc85ee3708f5.1571227824.git.gitgitgadget@gmail.com>
"Carlo Marcelo Arenas Belón via GitGitGadget" <gitgitgadget@gmail.com> writes:
> builtin/grep.c | 1 + > grep.c | 34 +++++++++++++++++++++++++++++++++- > grep.h | 1 + > 3 files changed, 35 insertions(+), 1 deletion(-)
Show 6 quoted lines
> > +#if defined(USE_LIBPCRE2) > + if (!pcre2_global_context) > + pcre2_global_context = pcre2_general_context_create( > + pcre2_malloc, pcre2_free, NULL); > +#endif
This part should use the same "#ifdef" as the other one which is a minor nit, for consistency. I do not care too deeply which way we unify, but we should stick to one.
> + > #ifdef USE_LIBPCRE1 > pcre_malloc = malloc; > pcre_free = free;
Other than that, all 3 patches look sensible, and they certainly got simplified by dropping the conditional ;-).