Re: [RFC PATCH v4 2/3] grep: make PCRE2 aware of custom allocator

2019-08-07 Thread Junio C Hamano
Carlo Marcelo Arenas Belón writes: As we already have such an ifdef block here... > +#ifdef USE_LIBPCRE2 > +static pcre2_general_context *pcre2_global_context; > + > +#ifdef USE_NED_ALLOCATOR > +static void *pcre2_malloc(PCRE2_SIZE size, MAYBE_UNUSED void *memory_data) > +{ > + return xmall

[RFC PATCH v4 2/3] grep: make PCRE2 aware of custom allocator

2019-08-07 Thread Carlo Marcelo Arenas Belón
94da9193a6 (grep: add support for PCRE v2, 2017-06-01) didn't include a way to override the system allocator, and so it is incompatible with USE_NED_ALLOCATOR. The problem was made visible when an attempt to avoid a leak in a data structure that is created by the library was passed to NED's free f