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 Dave Mitchell other posts by this author
Mar 2 2005 1:22PM messages near this date
Re: (blead patch) New TRIE regex patch | Re: (blead patch) New TRIE regex patch
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 and (b) I havn't looked at your original
patch and don't really feel up to it at the moment (see (a)), I don't
have any idea of what tmp thing you're creating. Is it during regex
compilation or execution? What purpose does it serve;  how often is it
created; what lifetime should it have during normal execution?

>  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.

-- 
There's a traditional definition of a shyster: a lawyer who, when the law
is against him, pounds on the facts; when the facts are against him,
pounds on the law; and when both the facts and the law are against him,
pounds on the table.
    -- Eben Moglen referring to SCO
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