Skip to content

Commit 65dbd0e

Browse files
committed
Devel::PPPort: threads-shared needs SvREFCNT_dec_NN()
and threads.xs no longer needs to define SvREFCNT_dec_NN()
1 parent baab724 commit 65dbd0e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

dist/Devel-PPPort/parts/inc/SvREFCNT

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ __UNDEFINED__
7676
# endif
7777
#endif
7878

79+
/* not as efficient as the real thing, but it works */
80+
__UNDEFINED__ SvREFCNT_dec_NN(sv) SvREFCNT_dec(sv)
81+
7982
__UNDEFINED__ SvREFCNT_inc_simple_void(sv) STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END
8083
__UNDEFINED__ SvREFCNT_inc_simple_NN(sv) (++SvREFCNT(sv), (SV*)(sv))
8184
__UNDEFINED__ SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
@@ -110,13 +113,15 @@ SvREFCNT()
110113
mXPUSHi(SvREFCNT(sv) == 8);
111114
SvREFCNT_inc_simple_void_NN(sv);
112115
mXPUSHi(SvREFCNT(sv) == 9);
116+
SvREFCNT_dec_NN(sv);
117+
mXPUSHi(SvREFCNT(sv) == 8);
113118
while (SvREFCNT(sv) > 1)
114119
SvREFCNT_dec(sv);
115120
mXPUSHi(SvREFCNT(sv) == 1);
116121
SvREFCNT_dec(sv);
117-
XSRETURN(14);
122+
XSRETURN(15);
118123

119-
=tests plan => 14
124+
=tests plan => 15
120125

121126
for (Devel::PPPort::SvREFCNT()) {
122127
ok(defined $_ and $_);

dist/threads/threads.xs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
#ifndef sv_dup_inc
1515
# define sv_dup_inc(s,t) SvREFCNT_inc(sv_dup(s,t))
1616
#endif
17-
#ifndef SvREFCNT_dec_NN
18-
# define SvREFCNT_dec_NN(x) SvREFCNT_dec(x)
19-
#endif
2017
#ifndef PERL_UNUSED_RESULT
2118
# if defined(__GNUC__) && defined(HASATTRIBUTE_WARN_UNUSED_RESULT)
2219
# define PERL_UNUSED_RESULT(v) STMT_START { __typeof__(v) z = (v); (void)sizeof(z); } STMT_END

0 commit comments

Comments
 (0)