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
|