Re: [pcre-dev] Internal errors and crashes with quantified …

Page principale
Supprimer ce message
Auteur: Philip Hazel
Date:  
À: Graycode
CC: pcre-dev
Sujet: Re: [pcre-dev] Internal errors and crashes with quantified subroutines
On Wed, 23 Nov 2011, Graycode wrote:

> The size consideration seems like a good candidate to be moved from
> pcre_compile.c, becoming a new config.h entry.


I was not going to bother with that.

> Perhaps then the need for malloc could be conditional at compile time
> depending on whether or not the size had been raised beyond the
> default expectation.


The need for malloc will be when the number of forward references gets
very large.

> It may also be important that the check limit be adjusted with
> consideration of LINK_SIZE.


I will make the default size LINK_SIZE dependent.

> I have a sneaky feeling you've already considered a config.h entry
> and adjusting the check. If possible I would prefer not to have an
> additional (though temporary) malloc be done within every compile
> when configured for the usual most-common PCRE configuration.


Indeed.

> Yet I'm only one voice in the forest, one that is very often too
> conservative.


I'm often conservative, as I date from the days when 32K (sic) was a lot
of memory.

The idea is to use the currently stack-allocated memory until it runs
out, then replace it with malloc-ed memory as required. The malloc will
then only kick in for certain patterns, not every one.

Philip

--
Philip Hazel