develooper Front page | perl.perl5.porters | Postings from October 2014

Re: Shared padlists

Thread Previous | Thread Next
Dave Mitchell
October 28, 2014 12:23
Re: Shared padlists
Message ID:
On Tue, Oct 28, 2014 at 05:34:45AM -0000, Father Chrysostomos wrote:
> If we could extend padlists to hold a boolean indicating whether the 
> sub is being called (i.e., !!CvDEPTH), then we could make sub clones
> share padlists.  If the padlist is in use when a sub is about to be
> called (and the sub itself has a CvDEPTH of 0), then that means the
> padlist is shared with another sub that is currently running, so it
> needs to be cloned.  The sub we are calling then keeps its own pad-
> list from that point on.

I worry that this adds a new test to every pp_entersub() call, and
involves a new flag that must be reset/restored on every sub exit
(deliberately or via dying), which may slow down all sub calls.

Also, is a boolean flag in the pad sufficient, or would you need a
counter, to handle recursion? Perhaps CvDEPTH should just be moved into
the pad?

So I like the idea in theory, but worry in practice.

"Emacs isn't a bad OS once you get used to it.
It just lacks a decent editor."

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About