Re: [PATCH] SQUASH
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Aug 10, 2019, 13:57 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1908101556530.46@tvgsbejvaqbjf.bet>
- In-Reply-To
- <20190810030315.7519-1-carenas@gmail.com>
Hi Carlo,
On Fri, 9 Aug 2019, Carlo Marcelo Arenas Belón wrote:
Show 9 quoted lines
> diff --git a/grep.c b/grep.c > index 8255ec956e..233072ed80 100644 > --- a/grep.c > +++ b/grep.c > @@ -482,6 +482,7 @@ static void free_pcre1_regexp(struct grep_pat *p) > #endif /* !USE_LIBPCRE1 */ > > #ifdef USE_LIBPCRE2 > +#ifdef USE_NED_ALLOCATOR
I really, really, really, really, _really_ don't want this to be a compile-time thing. Really. No, really. I mean it.
Ciao, Dscho
Show 25 quoted lines
> static void *pcre2_malloc(PCRE2_SIZE size, MAYBE_UNUSED void *memory_data)
> {
> return xmalloc(size);
> @@ -491,6 +492,7 @@ static void pcre2_free(void *pointer, MAYBE_UNUSED void *memory_data)
> {
> free(pointer);
> }
> +#endif
>
> static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt)
> {
> @@ -505,7 +507,9 @@ static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt
>
> assert(opt->pcre2);
>
> +#ifdef USE_NED_ALLOCATOR
> p->pcre2_general_context = pcre2_general_context_create(pcre2_malloc, pcre2_free, NULL);
> +#endif
> p->pcre2_compile_context = pcre2_compile_context_create(p->pcre2_general_context);
>
> if (opt->ignore_case) {
> --
> 2.23.0.rc2
>
>