This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc/gcc ChangeLog Makefile.in fixinc/Makefile. ...


Zack wrote:
> I am not clear on the allocation pattern in regex.c, because the file
> is very complicated and hides stuff behind lots of macros, but all
> the match primitives are structured like this:
> 
> match()
> {
>   setup work
>   match_internal()
> #ifdef C_ALLOCA
>   alloca(0);
> #endif
> }

As long as ``setup work'' doesn't involve calls to alloca,
then the problem is solved.

> If the problem recurs, we could just stick an alloca(0) call into the
> loop in fixincludes.

Look at the preprocessed code to check.  I'd rather see match reworked:

> match( .... )
> {
> #ifdef C_ALLOCA
>   static int allocating_match( .... );
>   int res = allocating_match( .... );
>   alloca(0);
>   return res;
> }
> static int allocating_match( .... )
> {
> #endif
>   setup work
>   match_internal()
> }

It should not be the problem of a regex user to know, understand
and compensate for misuse of memory management by regex.  I suspect
that is what the ``#ifdef C_ALLOCA'' is about.

 - Bruce

P.S. I seem to be experiencing problems getting my email from gnu.org.
I'll have to chase that when I have a chance


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]