[KinoSearch] Orderly global destruction
Nathan Kurz
nate at verse.com
Wed Feb 20 20:04:18 PST 2008
On 2/20/08, Marvin Humphrey <marvin at rectangular.com> wrote:
> It's kind of
> pointless to create and then immediately destroy the outer RV, but we
> have to do things that way because there are no public Perl C API
> functions that allow for the direct creation of an inner object.
It's been a while since I've done this, but isn't the inner object
just a SV with the IV field pointing to the C object? If so, could
you create it directly? I think the exact type of SV shouldn't matter
much, as everything (I think ) can store an IV.
A little quick web searching seems to show that current idiom is
something like sv_set_iv(sv, PTR2IV(ptr)). Is the problem that PTR2IV
isn't public? If so, I'd guess that would have to be just an
oversight, as traditionally it was just a (IV) cast.
The solution you described seems like it would work fine, but maybe
the direct creation approach would sidestep the need for it.
Nathan Kurz
nate at verse.com (not very good at lurking)
More information about the kinosearch
mailing list