in reply to Re^2: odd line in windows
in thread odd line in windows
The typemap automatically creates a reference to it and returns the reference. It's refcount is off by one, though.
use strict; use warnings; use Devel::Peek qw( Dump ); use Inline C => <<'__EOI__'; AV* f() { return newAV(); } __EOI__ Dump(f());
>perl -MInline=FORCE,NOISY,NOCLEAN a.pl ... SV = IV(0x7bbf18) at 0x7bbf1c REFCNT = 1 FLAGS = (TEMP,ROK) RV = 0x7bc05c SV = PVAV(0x7bcec8) at 0x7bc05c REFCNT = 2 <--- XXX FLAGS = () ARRAY = 0x0 FILL = -1 MAX = -1 ARYLEN = 0x0 FLAGS = (REAL)
Making it mortal doesn't help. So unless I'm missing something, this can only be used if you actually hold a reference to the array you return.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: odd line in windows
by syphilis (Archbishop) on Sep 08, 2011 at 10:58 UTC | |
by BrowserUk (Patriarch) on Sep 08, 2011 at 11:12 UTC | |
by syphilis (Archbishop) on Sep 08, 2011 at 11:29 UTC | |
by BrowserUk (Patriarch) on Sep 08, 2011 at 11:58 UTC | |
by syphilis (Archbishop) on Sep 08, 2011 at 13:24 UTC | |
| |
by tye (Sage) on Sep 08, 2011 at 16:51 UTC | |
| |
by ikegami (Patriarch) on Sep 08, 2011 at 20:00 UTC | |
| |
by ikegami (Patriarch) on Sep 08, 2011 at 21:22 UTC | |
by ikegami (Patriarch) on Sep 09, 2011 at 03:20 UTC | |
by ikegami (Patriarch) on Sep 08, 2011 at 19:53 UTC |