Mailing List Archive

guts question (mortal RV's)
Hi

I was wondering whether RV's need to be mortalized as well ?
The guts manual doesn't explicitly deal with this
and grepping through some code, i din't find anyone doing this.

Sven
Re: guts question (mortal RV's) [ In reply to ]
In <199511071216.NAA09550@dns.ufsia.ac.be>
On Tue, 7 Nov 1995 13:16:52 +0100 (MET)
Sven Verdoolaege <skimo@dns.ufsia.ac.be> writes:
>Hi
>
>I was wondering whether RV's need to be mortalized as well ?
>The guts manual doesn't explicitly deal with this
>and grepping through some code, i din't find anyone doing this.
>
An RV is just one type of SV which happens to contain
a reference to something. Creating the reference increments the reference count
of the "something", and freeing the SV decrements it. Making the SV mortal
automates the freeing of the SV and so decrementing the reference count
of the something. Thus so long as the SV which has the SvRV is appropriately
mortal, and the reference count of the "something" is correct
there is no need to make the "something" mortal.

Hope that helps.