develooper Front page | perl.perl6.internals | Postings from February 2001

Re: Garbage collection (was Re: JWZ on s/Java/Perl/)

Thread Previous | Thread Next
Uri Guttman
February 15, 2001 11:26
Re: Garbage collection (was Re: JWZ on s/Java/Perl/)
Message ID:
>>>>> "TB" == Tim Bunce <> writes:

  TB> As a part of that the weak reference concept, bolted recently into
  TB> perl5, could be made more central in perl6.

  TB> Around 92.769% of the time circular references are known to be
  TB> circular by the code that creates them (like a 'handy' ref back to
  TB> a parent node).  Having a weakref, or similar, operator in the
  TB> language would help greatly.

i second this. i am doing just what tim mentions. i have a child and
parent object referring back to each other for callback purposes. the
parent needs to own the child and the child has to have a parent ref to
make a method callback in the parent. there is no way out of creating
circular refs in that situation. i have to do an explicit object
shutdown so i don't leak ram. this isn't a big problem in stem since you
have to explicitly unregister stuff as well (that can't be done with
scope exit) but it would still be nice not to have to worry about the
ref loops.


Uri Guttman  ---------  ----------
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------
The Best Search Engine on the Net  ----------

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