Re: [PATCH] Use Glib's infrastructure for attaching magic

Florian Ragwitz <rafl debian org> writes:

      data_sv = newSViv (PTR2IV (wrapper));
-     sv_magic ((SV *) dummy_cv, 0, PERL_MAGIC_ext, (const char *) data_sv, 0);
+     gperl_attach_mg ((SV *) dummy_cv, data_sv);

Incidentally, that data_sv looks like it's leaked on DESTROY -- with or
without this different magicness.

Is there any reason it's not the "wrapper" pointer directly put into the
magic?  It holds any pointer can it, doesn't have to be an SV*?

Likewise the "stuff" in GtkTreeSortable.xs.  But except the newCONSTSUB
is presumably a much bigger leak if it's a permanent addition to the
symbol table.  Could it get away with the same subr name each time?  Or
is there an easy way to make an anon sub?

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]