Hi Aleks,

On Fri, Jul 21, 2017 at 09:03:27AM +0200, Aleksandar Lazic wrote:
> I thought something like
> 
> `my_pcrealloc` use `create_pool` inside and `my_pcrefree` use 
> `pool_destroy2` but one of the main question is how does the pcre2 
> handle the custom memory struct we have in the pools.
> 
> http://git.haproxy.org/?p=haproxy.git;a=blob;f=src/memory.c;hb=HEAD#l40
> http://git.haproxy.org/?p=haproxy.git;a=blob;f=src/memory.c;hb=HEAD#l198

There wouldn't be any benefit in doing this because our pools are fixed
size and are not compatible with a malloc() call by definition. Also,
pcre will call malloc() while compiling the regex, which is normally
not done at run time so there's no benefit in trying to optimize for
performance during this stage. However I agree that instrumenting a
malloc() call is sometimes quite useful.

Willy

Reply via email to