in reply to Math::BigInt::GMP - direct access to the gmp integer value
(in attach_mpz_to_sv) uses pointer to vtbl_gmp defined in gmp.xs, and you're comparing with a pointer to an object defined in your file. Those are two different objects and have different addresses.sv_magicext(SvRV(sv), NULL, PERL_MAGIC_ext, &vtbl_gmp, (void *)mpz, 0 +);
As for deleting the line && mg->mg_virtual == &vtbl_gmp, well, Perl's magic is like black magic to me :) but perlapi says: Note that "sv_magicext" will allow things that "sv_magic" will not. In particular, you can... add more than one instance of the same 'how' (so, some other module can add another PERL_MAGIC_ext struct to the linked list of magics).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Math::BigInt::GMP - direct access to the gmp integer value
by syphilis (Archbishop) on Jan 10, 2016 at 05:26 UTC | |
by Anonymous Monk on Jan 10, 2016 at 05:53 UTC |