(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).
In reply to Re: Math::BigInt::GMP - direct access to the gmp integer value
by Anonymous Monk
in thread Math::BigInt::GMP - direct access to the gmp integer value
by syphilis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |