ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl5-porters
perl5-porters
Re: (blead patch) New TRIE regex patch
by Demerphq other posts by this author
Mar 2 2005 1:40PM messages near this date
Re: (blead patch) New TRIE regex patch | Re: (blead patch) New TRIE regex patch
On Wed, 2 Mar 2005 21:22:55 +0000, Dave Mitchell <davem@[...].com>  wrote:
>  On Wed, Mar 02, 2005 at 09:52:46PM +0100, demerphq wrote:
>  > Ok, so if im not using mortals, but rather SAVEFREEPV it looks like
>  > the data is being stored on the save stack and not the tmpstack. So do
>  > i still need the SAVETMPS/FREETMPS? Can I not just use ENTER/LEAVE by
>  > itself?
>  
>  yes. Or possibly not even needing the ENTER/LEAVE. It all depends.
>  Since (a) I've still got a cold 

Sorry to hear that. :-(

>  (b) I havn't looked at your original patch and don't really feel up to it at the 
>  moment (see (a)), 

Fair enough. Its a big patch. 

> I don't have any idea of what tmp thing you're creating. 

Basically a short array of longs/void *

>  Is it during regex compilation or execution? 

Execution.

>  What purpose does it serve;  

It stores a set of information about where the char pointer was when a
given accepting state was entered. When more than one such point was
encountered its necessary to try (with a call to regmatch) to match
the rest of the regex after the tree at each point looking for a total
match. The array stores the state/positions remaining to be attempted.

>  how often is it created; 

Possibly often. Its hard to say. 

> what lifetime should it have during normal execution?

It should be freed as soon as the internal call to regmatch() completes.

>  
>  > I also wonder if there is a way I can save a variable somehow so its
>  > freed if the program dies, but otherwise is freed by myself. Is that
>  > possible somehow?
>  
>  Well, thatus what all the various ENTER/LEAVE, SAVETMPS type schemes do.
>  At the point in your code where you do LEAVE (or FREETMPS or whatever),
>  your SV will be freed. If your code dies before it gets to the line
>  containing the LEAVE, perl itself will do any necessary unwinding of the
>  savestack, ie it implicitly calls LEAVE on your behalf.

Ok, im going to meditate on all of this. Good luck with your cold.

Cheers,
Yves



-- 
First they ignore you, then they laugh at you, then they fight you,
then you win.
  +Gandhi
Thread:

Yitzchak Scott-Thoennes
Demerphq

Demerphq
Yitzchak Scott-Thoennes

Dave Mitchell
Demerphq
Dave Mitchell
Demerphq
Dave Mitchell

Demerphq
Demerphq
Yitzchak Scott-Thoennes
Rafael Garcia-Suarez

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved