in reply to Re^2: PerlXS typemap and reference counting
in thread PerlXS typemap and reference counting
The REFCNT of those 3 dumps is 1, 2, and 1 respectively.use strict; use warnings; use Devel::Peek; use Inline C => Config => CLEAN_AFTER_BUILD => 0, BUILD_NOISY => 1; use Inline C => <<'EOC'; void incref(SV * sv) { SvREFCNT_inc(sv); } void decref (SV * sv) { SvREFCNT_dec(sv); } EOC my $str = 'hello world'; Dump $str; print "\n"; incref $str; Dump $str; print "\n"; decref $str; Dump $str;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: PerlXS typemap and reference counting
by BrowserUk (Patriarch) on Apr 24, 2016 at 12:27 UTC |