On Thu, Aug 18, 2005 at 01:54:23PM -0500, David Nicol wrote:
> > This would not work. The same sub entry op may call many different
> > functions:
> > 
> >     $_->foo() for qw(A B C::D);
> 
> Under discussion is optimizing in the case of typed localized variables.
> 
>       my dog $iggy;
>       $iggy->make_sound;  # bound early to dog::make_sound due to declared 
> type
> 
> not a general early binding.

@Dog::ISA = qw(Mammal);
...
my Mammal $x = new Dog;
$x->foo(); # may be Dog::foo() or Mammal::foo()

> >  [unifying ops and SVs] would be a Dumb Thing.
> 
> Do they have reference counts?  I guess I can look at the source for once.
> BASEOP in op.h does not appear to define reference count field.
> 
> Being able to recycle optree memory is another thing that would
> be more trouble than its worth.  But repeated eval-strings isn't a memory
> leak --- how do we do that now?  Mark and sweep? Return opnodes to
> a pool after an eval-string unless they get referred to  by something external
> to the eval?

ops are in a tree of ops that are attached to a CV. The head of the op
tree has a refcnt, so that the tree can be shared amongst several CVs.
When the last CV is freed, the tree is freed. Each OP struct is usually
indivdually malloced or freed, although there is code, not normally
enabled, to allocate them from arenas.

This is of course irrelvant as to whether unifying OPs and SVs
would be a good thing.

-- 
In the 70's we wore flares because we didn't know any better.
What possible excuse does the current generation have?

Reply via email to