new() in `{ my $ap; $ap = [ Ob->new(), $ap ]; }' ? Their destruc..." /> What Happens To Objects Lost In "unreachable" Memory..... ? new() in `{ my $ap; $ap = [ Ob->new(), $ap ]; }' ? Their destruc..." /> new() in `{ my $ap; $ap = [ Ob->new(), $ap ]; }' ? Their destruc..." />
Answers

Question and Answer:

  Home  Perl Programming

⟩ What happens to objects lost in "unreachable" memory..... ?

What happens to objects lost in "unreachable" memory, such as the object returned by Ob->new() in `{ my $ap; $ap = [ Ob->new(), $ap ]; }' ?

Their destructors are called when that interpreter thread shuts down.

When the interpreter exits, it first does an exhaustive search looking for anything that it allocated. This allows Perl to be used in embedded and multithreaded applications safely, and furthermore guarantees correctness of object code.

 124 views

More Questions for you: