Re: [pcre-dev] pcre_fullinfo with PCRE_INFO_JITSIZE fails wi…

Top Page
Delete this message
Author: Philip Hazel
Date:  
To: Zoltán Herczeg
CC: pcre-dev
Subject: Re: [pcre-dev] pcre_fullinfo with PCRE_INFO_JITSIZE fails with SVN 921
On Mon, 20 Feb 2012, Zoltán Herczeg wrote:

> 1) Handling out-of-memory situations: What should happen if some (not
> all) compilation phase is failed because out-of-memory was occured.
> For example study is called with PCRE_STUDY_JIT_COMPILE and
> PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE and only the first one is
> successful because there is not enough memory for the second
> compilation. At the moment we return with a successful compilation,
> although the hard partial matching will be done by interpreter. Is
> this behaviour ok or shall we free the first one as well and return
> with fail?


I don't think you should return success unless you have done everything
the user asked, so I guess you should return fail. However, I don't feel
strongly enough to object to the other way of doing it, as long as the
user can find out what has happened. So there would need to be some
flags somewhere indicating which modes have succeeded and which have
failed.

At the moment, pcretest says "JIT study was successful" for a success
return. I would like to be able to add something like "(normal, partial
hard)" to indicate which modes are available.

> 2) Shall PCRE_INFO_JITSIZE return with the sum of all code sizes or
> just the size of the function for normal matching? Shall we introduce
> other size getters for the other compilation modes?


I agree with Ralf that returning with the sum of all sizes is what
people would most likely expect. I cannot see any reason (except perhaps
general interest) in getting the different sizes for each mode, so I
don't think it is worth the work of doing that.

Philip

--
Philip Hazel