in reply to Re^3: Managing C library memory in XS
in thread Managing C library memory in XS
Yeah ... That's the same solution as Corion suggested above. Just not as an extra indirection in the Perl layer, but at the C layer.
So now there's 3 solutions. All of them keeping a reference to the "owning" C object.I think all of them will work, but I still wonder what Perl actually guarantees about dualvalue SVs. Since its practicaly encouraged by Scarlar::Util, I would have expected such a statement in perlapi or perlguts.
To put it further into perspective. Here's Devel::Peek description of the T_PTROBJ typemap SV.. As it clearly shows, the PV and NV slots are empty (as standard). But what happens if you use them?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Managing C library memory in XS
by RonW (Parson) on May 06, 2014 at 16:32 UTC | |
by petermogensen (Sexton) on May 06, 2014 at 19:21 UTC |