develooper Front page | perl.perl5.porters | Postings from December 2012

? dangerous paradigm in perl.c global destruction ?

Thread Next
From:
Karl Williamson
Date:
December 23, 2012 21:51
Subject:
? dangerous paradigm in perl.c global destruction ?
Message ID:
50D77CDD.1060401@khwilliamson.com
I was thinking about this paradigm that is in perl.c perl_destruct()

     SvREFCNT_dec(PL_utf8_toupper);
     PL_utf8_toupper = NULL;

If for some reason that SV does not have a ref count of 1 (or less), 
then it will be inappropriately set to NULL.

It seems to me that it would be safer to free it unconditionally than to 
decrement the ref count.

Is there a problem with doing that?  If no problem, which free function 
should be used?


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About