diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-03-01 06:52:26 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-03-01 06:52:26 +0000 |
commit | fbbbcc485c1d03c76a91f998e1e4492c8ad56b38 (patch) | |
tree | 3b1a893d2288b11451c4d4419edd75f4f85d2481 /sv.c | |
parent | c69f6586a27b86846a13e0177336730d72b33c95 (diff) | |
parent | 1c1c7f20b839aeb1c04942d0884c3efb087d3e4a (diff) | |
download | perl-fbbbcc485c1d03c76a91f998e1e4492c8ad56b38.tar.gz |
[asperl] integrate mainline changes
p4raw-id: //depot/asperl@607
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -2295,7 +2295,7 @@ sv_usepvn(register SV *sv, register char *ptr, register STRLEN len) void sv_usepvn_mg(register SV *sv, register char *ptr, register STRLEN len) { - sv_usepvn_mg(sv,ptr,len); + sv_usepvn(sv,ptr,len); SvSETMAGIC(sv); } @@ -2401,7 +2401,7 @@ sv_catpv(register SV *sv, register char *ptr) void sv_catpv_mg(register SV *sv, register char *ptr) { - sv_catpv_mg(sv,ptr); + sv_catpv(sv,ptr); SvSETMAGIC(sv); } @@ -2876,13 +2876,15 @@ SV * sv_newref(SV *sv) { if (sv) - SvREFCNT(sv)++; + ATOMIC_INC(SvREFCNT(sv)); return sv; } void sv_free(SV *sv) { + int refcount_is_zero; + if (!sv) return; if (SvREADONLY(sv)) { @@ -2897,7 +2899,8 @@ sv_free(SV *sv) warn("Attempt to free unreferenced scalar"); return; } - if (--SvREFCNT(sv) > 0) + ATOMIC_DEC_AND_TEST(refcount_is_zero, SvREFCNT(sv)); + if (!refcount_is_zero) return; #ifdef DEBUGGING if (SvTEMP(sv)) { |