in reply to Re^3: Garbage Collection and undef
in thread Garbage Collection and undef
I'm not sure where you got this information from, but it isn't true. Perl5 uses simple immediate reference counting, and if you remove your last external reference to a cyclic structure without breaking the cycle you'll leak that memory.
Some additional optimisations are done: notably things pushed temporarily onto the main stack (eg function arguments) usually do not have their reference count increased to reflect the fact; this turns out to be the source of numerous bugs however, and as we've added more exceptions and workarounds to fix those the benefit has decreased to the point we're considering removing the optimisation altogether.
Perl6 has been designed from the start to use GC, but I don't know much detail about the precise flavour of GC used.
Hugo
|
|---|