[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: Regex backreference bug in recursion/thread (status & questions)



Gurusamy Sarathy writes:
> >  * Would it make sense to do the actual memory allocation for the pad
> >    values for startp[], etc at the very beginning of the regex execution
> >    (I'm not _exactly_ sure where that is _all_ the time!). That way new
> >    memory allocation would happen at every recursion or thread entry
> >    point.
> 
> It should be possible to hold a reference to the target string and simply
> point into it.  This avoids memory allocations.

And this would be really easy with the implemenation of copy-on-write
I did for weakrefs (or any modification thereof).

> >  * Would it make sense to use standard scratchpad api calls (padsv,
> >    padav) to assign/retrieve values of startp[i], etc during the regex?
> 
> No, see above.  Once the pad entry is allocated during compilation
> of the RE, 

I hope you mean "during creation of PMOP".

>	     the PMOP has an index into the pad that will always be
> pointing at a valid SV* (which can hold anything you want).  You then
> simply need to dig into this SV* to get at your data.

Ilya


Follow-Ups from:
Gurusamy Sarathy <gsar@ActiveState.com>
References to:
Gurusamy Sarathy <gsar@ActiveState.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]